Do not hardcode full path to restorecon
Use which command to detect if the executable is present or not
This commit is contained in:
parent
11b7980da6
commit
2f87baa5a4
2 changed files with 6 additions and 2 deletions
4
debian/nut-client.postinst
vendored
4
debian/nut-client.postinst
vendored
|
@ -39,7 +39,9 @@ case "$1" in
|
||||||
if [ -d /var/run/nut ] ; then
|
if [ -d /var/run/nut ] ; then
|
||||||
chown root:nut /var/run/nut
|
chown root:nut /var/run/nut
|
||||||
chmod 770 /var/run/nut
|
chmod 770 /var/run/nut
|
||||||
[ -x /sbin/restorecon ] && /sbin/restorecon /var/run/nut
|
if which restorecon >/dev/null 2>&1; then
|
||||||
|
restorecon /var/run/nut
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if dpkg --compare-versions "$2" le "2.6.4-2~" &&
|
if dpkg --compare-versions "$2" le "2.6.4-2~" &&
|
||||||
|
|
4
debian/nut-server.postinst
vendored
4
debian/nut-server.postinst
vendored
|
@ -39,7 +39,9 @@ case "$1" in
|
||||||
if [ -d /var/run/nut ] ; then
|
if [ -d /var/run/nut ] ; then
|
||||||
chown root:nut /var/run/nut
|
chown root:nut /var/run/nut
|
||||||
chmod 770 /var/run/nut
|
chmod 770 /var/run/nut
|
||||||
[ -x /sbin/restorecon ] && /sbin/restorecon /var/run/nut
|
if which restorecon >/dev/null 2>&1; then
|
||||||
|
restorecon /var/run/nut
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make sure that /var/lib/nut has the correct permissions and ownerships
|
# make sure that /var/lib/nut has the correct permissions and ownerships
|
||||||
|
|
Loading…
Reference in a new issue