From 9633439f0b0c5845d93a2e0ed846d2a879fce9d3 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 29 Aug 2017 18:18:35 +0000 Subject: [PATCH] added script for making group equiv to user access --- scripts/security/dos_perm.sh | 2 +- scripts/security/group_perm.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 scripts/security/group_perm.sh diff --git a/scripts/security/dos_perm.sh b/scripts/security/dos_perm.sh index 89124375..66d7039a 100644 --- a/scripts/security/dos_perm.sh +++ b/scripts/security/dos_perm.sh @@ -1,5 +1,5 @@ #!/bin/bash -# dos_perm: whacks a directory with the most open set of permissions +# dos_perm: gives a directory the most open set of permissions # available to the dos/windoze attrib command. folder="$1"; shift diff --git a/scripts/security/group_perm.sh b/scripts/security/group_perm.sh new file mode 100644 index 00000000..676fb1da --- /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 "$current" -type d -exec chmod u+rwx,g+rwx {} ';' +### >/dev/null 2>/dev/null + find "$current" -type f -exec chmod u+rw,g+rw {} ';' +### >/dev/null 2>/dev/null +done + -- 2.34.1