aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/file_perm.sh
blob: f99ef97b10adcea59867ac55f185c50de2754ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

if [[ ! -s $1 ]]; then
	echo "I need a msec permfile in argument".
	exit 1
fi

echo -n "Setting files permissions : "

grep -v "^#" $1 | while read file owner perm; do
	if [[ ${owner} != current ]]; then
		chown ${owner} ${file}
	fi
	chmod ${perm} ${file}
done

echo "done."