aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/file_perm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'init-sh/file_perm.sh')
-rwxr-xr-xinit-sh/file_perm.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/init-sh/file_perm.sh b/init-sh/file_perm.sh
new file mode 100755
index 0000000..9f76791
--- /dev/null
+++ b/init-sh/file_perm.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+IFS="
+"
+
+for line in `cat /$1`; do
+ file=`echo ${line} | awk '{print $1}'`
+ owner=`echo ${line} | awk '{print $2}'`
+ perm=`echo ${line} | awk '{print $3}'`
+
+ if [ -a "${file}" ]; then
+ if [ ${owner} != "current" ]; then
+ chown ${owner} ${file}
+ fi
+ chmod ${perm} ${file}
+ fi
+done
+
+