Do not hardcode full path to restorecon

Use which command to detect if the executable is present or not
This commit is contained in:
Laurent Bigonville 2013-01-26 01:12:41 +01:00
parent 11b7980da6
commit 2f87baa5a4
2 changed files with 6 additions and 2 deletions

View File

@ -39,7 +39,9 @@ case "$1" in
if [ -d /var/run/nut ] ; then
chown root:nut /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
if dpkg --compare-versions "$2" le "2.6.4-2~" &&

View File

@ -39,7 +39,9 @@ case "$1" in
if [ -d /var/run/nut ] ; then
chown root:nut /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
# make sure that /var/lib/nut has the correct permissions and ownerships