From 7a429f23d389f21d7f98737e6f641442c794226e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 26 Nov 2012 16:25:31 +0000 Subject: Merge Upstart job scripting support from Ubuntu, to handle the Upstart job being primary there. --- debian/openssh-server.prerm.in | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 debian/openssh-server.prerm.in (limited to 'debian/openssh-server.prerm.in') diff --git a/debian/openssh-server.prerm.in b/debian/openssh-server.prerm.in new file mode 100644 index 000000000..188434d27 --- /dev/null +++ b/debian/openssh-server.prerm.in @@ -0,0 +1,59 @@ +#! /bin/sh +# prerm script for ssh +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + remove|deconfigure) + case '@DISTRIBUTOR@' in + Ubuntu) + # Both init script and Upstart job are present; we want to + # operate on the Upstart job. + if [ -e /etc/init/ssh.conf ]; then + stop ssh || true + fi + ;; + *) + if [ -x /etc/init.d/ssh ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d ssh stop + else + /etc/init.d/ssh stop + fi + fi + ;; + esac + ;; + upgrade) + # remove symlink on downgrade to when it was a directory + if [ -L /usr/share/doc/openssh-server ] && \ + dpkg --compare-versions "$2" lt-nl 1:4.1p1-5; then + rm -f /usr/share/doc/openssh-server + fi + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 -- cgit v1.2.3