check_logfiles: update to 3.7.1
[omd.git] / debian / prerm.in
blobb350a18604faa626d37f58362898da84a3305dc7
1 #!/bin/sh
2 # prerm script for omd
4 # see: dh_installdeb(1)
6 set -e
8 # summary of how this script can be called:
9 # * <prerm> `remove'
10 # * <old-prerm> `upgrade' <new-version>
11 # * <new-prerm> `failed-upgrade' <old-version>
12 # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
13 # * <deconfigured's-prerm> `deconfigure' `in-favour'
14 # <package-being-installed> <version> `removing'
15 # <conflicting-package> <version>
16 # for details, see http://www.debian.org/doc/debian-policy/ or
17 # the debian-policy package
19 OMD="omd-###OMD_VERSION###"
21 case "$1" in
22 remove)
23 # Make sure no sites use that version
24 for link in /omd/sites/*/version
26 target=$(readlink $link 2>/dev/null) || continue
27 version=${target##*/}
28 if [ "$version" = "###OMD_VERSION###" ]
29 then
30 site=${link#/omd/sites/}
31 site=${site%/version}
32 echo "Site $site is still using this version!" >&2
33 exit 1
35 done
38 upgrade|deconfigure)
41 failed-upgrade)
45 echo "prerm called with unknown argument \`$1'" >&2
46 exit 1
48 esac
50 # dh_installdeb will replace this with shell code automatically
51 # generated by other debhelper scripts.
53 #DEBHELPER#
55 update-alternatives --remove omd /omd/versions/###OMD_VERSION###
57 exit 0