X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fsecurity%2Fnormal_perm.sh;fp=scripts%2Fsecurity%2Fnormal_perm.sh;h=73a7f941140d2805f1cfdacc540d17a1c395fb17;hb=aa3c39c42b175ba42febe295be6da7fae47713a8;hp=0000000000000000000000000000000000000000;hpb=5b2b4473bd46dc412b11d1372704a2d4ef7d0465;p=feisty_meow.git diff --git a/scripts/security/normal_perm.sh b/scripts/security/normal_perm.sh new file mode 100644 index 00000000..73a7f941 --- /dev/null +++ b/scripts/security/normal_perm.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# normal_perm: traverses directory trees and sets the permissions to a +# standard accessibility value. for fred, this is rwxr-xr-x for directories +# and rw-r--r-- for files. + +declare -a args=("$@") + +if [ -z "${args[*]}" ]; then + echo "no arguments provided." + exit 1; +fi + +for (( i=0; i < ${#args[*]}; i++ )); do + current="${args[i]}" +# echo "curr is $current" + find "$current" -type d -exec chmod 755 {} ';' +### >/dev/null 2>/dev/null + find "$current" -type f -exec chmod 644 {} ';' +### >/dev/null 2>/dev/null +done +