diff --git a/debian/nut-client.postinst b/debian/nut-client.postinst index bac6721..4b04850 100644 --- a/debian/nut-client.postinst +++ b/debian/nut-client.postinst @@ -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~" && diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index 4a718aa..3322126 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -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