scripts/gestion/set_droits.sh
glondu f877ee9b44 Plus propre.
darcs-hash:20061127064554-68412-bba7c0bc4dcd0efecaaceec1b3aee45d43952a1a.gz
2006-11-27 07:45:54 +01:00

33 lines
637 B
Bash
Executable file

#! /bin/sh
BASE=/usr/scripts/gestion
# On vire les truc de sauvegarde qui peuvent avoir des droits bizarres
# et ca fait plus propre
find $BASE -name '*~' -type f -exec rm -f '{}' ';'
chown -R respbats:adm $BASE
set_dr () {
if [[ -x $1 ]] ; then
chmod 775 $1
elif [[ $1 = "$BASE/clef-wifi" ]]; then
chmod 600 $1
elif [[ $1 = "$BASE/clef-encap" ]]; then
chmod 600 $1
elif [[ $1 = "$BASE/secrets.py" ]] || [[ $1 = "$BASE/secrets.pyc" ]]; then
chmod 640 $1
else
chmod 664 $1
fi
}
for i in $(ls $BASE)
do
set_dr $BASE/$i
done
for i in $(ls $BASE/gen_confs)
do
set_dr $BASE/gen_confs/$i
done