Only fix permissions of configfiles on first install.
This commit is contained in:
parent
68adcbdb65
commit
d54dd54840
3 changed files with 26 additions and 17 deletions
19
debian/nut-server.postinst
vendored
19
debian/nut-server.postinst
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue