add preinst script
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 15 Jan 2015 05:53:45 +0000 (06:53 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 15 Jan 2015 05:53:45 +0000 (06:53 +0100)
Older versions of the pve-firewall daemon do not restart
with HUP, so we need to do a stop/start.

debian/preinst [new file with mode: 0644]

diff --git a/debian/preinst b/debian/preinst
new file mode 100644 (file)
index 0000000..fc1191c
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    install|upgrade)
+       old_version=$2
+       if [ -e '/usr/sbin/pve-firewall' ]; then
+           if dpkg --compare-versions "$old_version" lt '1.0-16' ; then
+               echo "Detected old pve-firewall version - using stop/start to restart"
+               /usr/sbin/pve-firewall stop
+           fi
+       fi
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0