Merge branch 'upstream'
[rahunas] / debian / rahunas-weblogin.postrm
1 #!/bin/sh
2
3 set -e
4
5 if [ "$1" != "remove" ] && [ "$1" != "purge" ]; then
6   exit 0
7 fi
8
9 ## Source debconf library
10 . /usr/share/debconf/confmodule
11 db_version 2.0
12
13 #
14 # Remove or Purge the whole package
15 #
16
17 common_remove() {
18   if [ -d "/etc/apache2/conf.d" ]; then
19     if [ -L "/etc/apache2/conf.d/rahunas.conf" ]; then
20       rm /etc/apache2/conf.d/rahunas.conf
21     fi
22     invoke-rc.d apache2 reload || true
23   fi
24
25   if [ -L "/usr/share/rahunas/config.php" ]; then
26     rm /usr/share/rahunas/config.php
27   fi
28
29   if which pear > /dev/null 2>&1; then
30     echo "Uninstalling required PEAR packages.."
31     echo "Uninstalling XML_RPC2 package"
32     pear uninstall XML_RPC2 > /dev/null 2>&1 || true
33     echo "Uninstalling Cache_Lite package"
34     pear uninstall Cache_Lite > /dev/null 2>&1 || true
35     echo "Uninstalling Crypt_CHAP package"
36     pear uninstall Crypt_CHAP > /dev/null 2>&1 || true
37     echo "Uninstalling Auth_RADIUS package"
38     pear uninstall Auth_RADIUS > /dev/null 2>&1 || true
39     echo "Done .."
40   fi
41 }
42
43 case "$1" in
44 purge)
45   if which ucf >/dev/null 2>&1; then
46     ucf --purge /etc/rahunas/apache2.conf
47   fi
48
49   rm -f /etc/rahunas/apache2.conf
50
51   common_remove
52   ;;
53
54 remove)
55   common_remove
56   ;;
57 esac
58
59 #DEBHELPER#
60 exit 0