Only fix permissions of configfiles on first install.

This commit is contained in:
Laurent Bigonville 2013-01-13 17:31:58 +01:00
parent 68adcbdb65
commit d54dd54840
3 changed files with 26 additions and 17 deletions

View file

@ -19,15 +19,18 @@ case "$1" in
# fi
# make sure that conffiles are secured and have the correct ownerships
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
for file in ups.conf upsd.conf upsd.users ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
# on first install
if [ -z "$2" ] ; then
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
done
for file in ups.conf upsd.conf upsd.users ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
fi
done
fi
# make sure that /var/run/nut exists and has the correct ownerships
if [ ! -d /var/run/nut ] ; then