536075cd044305942bc3943cb03bbf706e4f1525
[ossec-hids-cn.git] / debian / postrm
1 #!/bin/sh
2 # postrm script for bind9-cn
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # summary of how this script can be called:
9 #        * <postrm> `remove'
10 #        * <postrm> `purge'
11 #        * <old-postrm> `upgrade' <new-version>
12 #        * <new-postrm> `failed-upgrade' <old-version>
13 #        * <new-postrm> `abort-install'
14 #        * <new-postrm> `abort-install' <old-version>
15 #        * <new-postrm> `abort-upgrade' <old-version>
16 #        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
17 # for details, see http://www.debian.org/doc/debian-policy/ or
18 # the debian-policy package
19
20 case "$1" in
21     purge)
22       # continue below
23     ;;
24
25     *)
26         exit 0
27     ;;
28 esac
29
30 # import CN-functions
31 . /usr/share/carnet-tools/functions.sh
32
33 # get installation directory
34 . /etc/ossec-init.conf
35 if [ "X${DIRECTORY}" = "X" ]; then
36     DIRECTORY="/var/ossec"
37 fi
38
39 # remove our block
40 local_rules="$DIRECTORY/rules/local_rules.xml"
41 if [ -e "$local_rules" ]; then
42     cp-update --comment '<!--' --comment-end '-->' \
43         -r ossec-hids-cn "$local_rules"
44 fi
45
46 # and start the service
47 if [ -x /usr/sbin/invoke-rc.d ]; then
48     invoke-rc.d ossec-hids restart
49 else
50     /etc/init.d/ossec-hids restart
51 fi
52
53 # dh_installdeb will replace this with shell code automatically
54 # generated by other debhelper scripts.
55
56 #DEBHELPER#
57
58 exit 0