From 13ae285ff536422872503a54aac6127fa63b505f Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Fri, 10 Oct 2014 15:52:47 +0000 Subject: [PATCH] contrib/DEBIAN: fixed package scripts git-svn-id: https://svn.fhem.de/fhem/trunk@6738 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DEBIAN/postinst | 18 +++++++----------- fhem/contrib/DEBIAN/postrm | 2 +- fhem/contrib/DEBIAN/prerm | 6 +++++- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fhem/contrib/DEBIAN/postinst b/fhem/contrib/DEBIAN/postinst index 1360611a5..c986c158d 100644 --- a/fhem/contrib/DEBIAN/postinst +++ b/fhem/contrib/DEBIAN/postinst @@ -1,5 +1,4 @@ - -#!/bin/sh +#!/bin/bash set -e @@ -9,18 +8,15 @@ fi chown -R fhem:root /opt/fhem -# prevent package fhem from being -# upgraded by apt-get upgrade - -apt-mark hold fhem -echo "fhem hold" | dpkg --set-selections - - # set up of autostart # Sysvinit; upstart no longer supported -mkdir -p /etc/init.d +#mkdir -p /etc/init.d cp /opt/fhem/contrib/init-scripts/fhem.3 /etc/init.d/fhem chmod ugo+x /etc/init.d/fhem update-rc.d fhem defaults -invoke-rc.d fhem start + +if test -f /etc/init.d/fhem; then + invoke-rc.d fhem start +fi + diff --git a/fhem/contrib/DEBIAN/postrm b/fhem/contrib/DEBIAN/postrm index 6d4235c52..fa59aa358 100755 --- a/fhem/contrib/DEBIAN/postrm +++ b/fhem/contrib/DEBIAN/postrm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e # required by lintian set +e # Don't know how to check presence of fhem in passwd with -e diff --git a/fhem/contrib/DEBIAN/prerm b/fhem/contrib/DEBIAN/prerm index b98f12a27..2d1ee8b77 100755 --- a/fhem/contrib/DEBIAN/prerm +++ b/fhem/contrib/DEBIAN/prerm @@ -2,8 +2,12 @@ set -e +apt-mark unhold fhem + # stop fhem if running -invoke-rc.d fhem stop +if test -f /etc/init.d/fhem; then + invoke-rc.d fhem stop +fi # remove fhem autostart update-rc.d fhem remove