diff --git a/contrib/DEBIAN/postrm b/contrib/DEBIAN/postrm index 59b1d2d31..dbc380760 100755 --- a/contrib/DEBIAN/postrm +++ b/contrib/DEBIAN/postrm @@ -1,6 +1,7 @@ #!/bin/sh -set -e +set -e # required by lintian +set +e # Don't know how to check presence of fhem in passwd with -e if grep -q fhem /etc/passwd; then userdel fhem @@ -13,3 +14,7 @@ if test -f /etc/init.d/fhem; then update-rc.d fhem remove rm /etc/init.d/fhem fi + +if test ! -x /sbin/initctl; then + update-rc.d -f fhem remove +fi diff --git a/contrib/DEBIAN/prerm b/contrib/DEBIAN/prerm index f5d3f8c1d..b86f7bb52 100755 --- a/contrib/DEBIAN/prerm +++ b/contrib/DEBIAN/prerm @@ -3,9 +3,9 @@ set -e if pgrep fhem.pl >/dev/null; then - if test -x /sbin/initctl; then - initctl stop fhem - else - invoke-rc.d fhem stop - fi + if test -x /sbin/initctl; then + initctl stop fhem + else + invoke-rc.d fhem stop + fi fi