aboutsummaryrefslogtreecommitdiffstats
path: root/debian/bitlbee-common.preinst
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-01-09 00:06:14 +0100
committerMarius Halden <marius.h@lden.org>2017-01-09 00:06:14 +0100
commit0644b8614aea470149f08a0357a73c7c601f00f5 (patch)
tree37843a02c3e69de7409341a73532a51662efdcb3 /debian/bitlbee-common.preinst
parent52ac0e03b0e69f43f6556a568bf82dabf3e5e4f0 (diff)
parentebed81cecf4be45436e25cb8e8c8b0f15c47751e (diff)
Merge branch 'master' into patched-master
Diffstat (limited to 'debian/bitlbee-common.preinst')
-rw-r--r--debian/bitlbee-common.preinst20
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/bitlbee-common.preinst b/debian/bitlbee-common.preinst
new file mode 100644
index 00000000..ad4b5a79
--- /dev/null
+++ b/debian/bitlbee-common.preinst
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+NAME=bitlbee
+PIDFILE=/var/run/$NAME.pid
+
+# git revision 7949d5a introduced dh_systemd.
+DH_SYSTEMD_REV="3.4.2+20160612+master+41-g7949d5a-git"
+
+# if upgrading from something older (including 3.4.2), kill the old daemon.
+# do this just once, this time, to allow systemd to manage it.
+if [ "$1" = 'upgrade' ]; then
+ if dpkg --compare-versions $2 lt $DH_SYSTEMD_REV; then
+ # we may not have init scripts here
+ start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE --name $NAME
+ fi
+fi
+
+#DEBHELPER#