nice new tool to show version of feisty meow
[feisty_meow.git] / scripts / security / group_perm.sh
1 #!/bin/bash
2 # group_perm: traverses directory trees and sets the permissions to allow the
3 # associated group "rw" on files and "rwx" on directories.
4
5 declare -a args=("$@")
6
7 if [ -z "${args[*]}" ]; then
8   echo "no arguments provided."
9   exit 1;
10 fi
11
12 for (( i=0; i < ${#args[*]}; i++ )); do
13   current="${args[i]}"
14 #  echo "curr is $current"
15   find -L "$current" -type d -exec chmod u+rwx,g+rwx {} ';'
16 ### >/dev/null 2>/dev/null
17   find -L "$current" -type f -exec chmod u+rw,g+rw {} ';'
18 ### >/dev/null 2>/dev/null
19 done
20