X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsecurity%2Fgroup_perm.sh;fp=scripts%2Fsecurity%2Fgroup_perm.sh;h=17731032e963557f70569c815a64258c10047c07;hb=7b39f7e279005c8466ef508220a532ce2aa4abf8;hp=0000000000000000000000000000000000000000;hpb=3fbd372b35b15a19fb171d5ae34294ff7b1e6485;p=feisty_meow.git diff --git a/scripts/security/group_perm.sh b/scripts/security/group_perm.sh new file mode 100644 index 00000000..17731032 --- /dev/null +++ b/scripts/security/group_perm.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# group_perm: traverses directory trees and sets the permissions to allow the +# associated group "rw" on files and "rwx" on directories. + +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 u+rwx,g+rwx {} ';' +### >/dev/null 2>/dev/null + find -L "$current" -type f -exec chmod u+rw,g+rw {} ';' +### >/dev/null 2>/dev/null +done +