X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsecurity%2Feasy_perm.sh;fp=scripts%2Fsecurity%2Feasy_perm.sh;h=472aa6f31aa96e71e8d9d55535228a52ecc6ab5e;hb=7b39f7e279005c8466ef508220a532ce2aa4abf8;hp=0000000000000000000000000000000000000000;hpb=3fbd372b35b15a19fb171d5ae34294ff7b1e6485;p=feisty_meow.git diff --git a/scripts/security/easy_perm.sh b/scripts/security/easy_perm.sh new file mode 100644 index 00000000..472aa6f3 --- /dev/null +++ b/scripts/security/easy_perm.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# easyperm: traverses directory trees and sets the permissions to a completely +# accessible value (rwxrwxrwx for directories and rw-rw-rw- 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 -L "$current" -type d -exec chmod 777 {} ';' +# >/dev/null 2>/dev/null + find -L "$current" -type f -exec chmod 666 {} ';' +# >/dev/null 2>/dev/null +done +