From: Dietmar Maurer Date: Thu, 15 Jan 2015 05:53:45 +0000 (+0100) Subject: add preinst script X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=commitdiff_plain;h=9f7f534fd2bbb8c40f313bd56dc3e643683234c1;hp=a6811508c4532792400c10ddf0ea8906e4b6653c add preinst script Older versions of the pve-firewall daemon do not restart with HUP, so we need to do a stop/start. --- diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..fc1191c --- /dev/null +++ b/debian/preinst @@ -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