source: php5-lliurex-compat/fuentes/debian/postrm @ 5339

Last change on this file since 5339 was 5339, checked in by hectorgh, 21 months ago

postrm only removes on remove option

File size: 1.5 KB
Line 
1#!/bin/sh
2# postrm script for php5-lliurex-compat
3#
4# see: dh_installdeb(1)
5
6set -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' <overwriter>
17#          <overwriter-version>
18# for details, see https://www.debian.org/doc/debian-policy/ or
19# the debian-policy package
20NOW=$(date +'%Y%m%d%m%s')
21
22case "$1" in
23    purge|remove|disappear)
24        if [ -d /etc/apache2-lliurex ]; then
25                mv /etc/apache2-lliurex /etc/apache2-lliurex-${NOW}
26        fi
27        for l in /usr/local/sbin/a*-lliurex; do
28                rm -f ${l}
29        done
30        if [ -d /var/log/apache2-lliurex ]; then
31                mv /var/log/apache2-lliurex /var/log/apache2-lliurex-${NOW}
32        fi
33        if [ -f /etc/init.d/apache2-lliurex ]; then
34                mv  /etc/init.d/apache2-lliurex /etc/apache2-lliurex-${NOW}/apache2-lliurex.init-d
35        fi
36        if [ -f /etc/logrotate.d/apache2-lliurex ]; then
37                mv /etc/logrotate.d/apache2-lliurex /etc/apache2-lliurex-${NOW}/apache2-lliurex.logrotate
38        fi
39    ;;
40
41    upgrade|failed-upgrade|abort-install|abort-upgrade)
42    ;;
43    *)
44        echo "postrm called with unknown argument \`$1'" >&2
45        exit 1
46    ;;
47esac
48
49# dh_installdeb will replace this with shell code automatically
50# generated by other debhelper scripts.
51
52#DEBHELPER#
53
54exit 0
Note: See TracBrowser for help on using the repository browser.