aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/file_perm.sh
blob: 9f76791a70db5ca7eff0b94cd06c28144546f7af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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