aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/file_perm.sh
diff options
context:
space:
mode:
authorYoann Vandoorselaere <yoann@mandriva.com>1999-11-25 19:44:10 +0000
committerYoann Vandoorselaere <yoann@mandriva.com>1999-11-25 19:44:10 +0000
commit78b13ca5f0677f9e6e5a07a18473a2d7724b51d0 (patch)
tree1aa278480009928f545f8668bc87c4eaafbc7e7b /init-sh/file_perm.sh
parent7f3bfad3df657529ee81b741c6fb10d847315c85 (diff)
downloadmsec-78b13ca5f0677f9e6e5a07a18473a2d7724b51d0.tar
msec-78b13ca5f0677f9e6e5a07a18473a2d7724b51d0.tar.gz
msec-78b13ca5f0677f9e6e5a07a18473a2d7724b51d0.tar.bz2
msec-78b13ca5f0677f9e6e5a07a18473a2d7724b51d0.tar.xz
msec-78b13ca5f0677f9e6e5a07a18473a2d7724b51d0.zip
Initial revision
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
+
+