Code

Added dependency to recode
[gosa.git] / debian / gosa.postrm
1 #! /bin/sh
2 # postrm script for GOsa
3 #
5 case "$1" in
6     purge|remove)
7         ## PURGE!!!
8         if [ "$1" = "purge" ] ; then
9             if [ -d /var/spool/gosa ] ; then
10                 echo "Removing /var/spool/gosa as requested."
11                 rm -Rf /var/spool/gosa
12             fi
13         fi
15         # Get apache versions running
16         servers=""
17         for srv in apache apache-ssl; do
18                 dpkg -s $srv | grep -q "^Status:.*not-installed"
19                 if [ $? -eq 1 ]; then
20                         servers="$srv $servers"
21                 fi
22         done
24         # Adapt server configs
25         for server in $servers ; do
26                 # remove GOsa include
27                 includefile=/etc/gosa/apache.conf
29                 case "$1" in
30                         purge)
31                                 if [ -e /usr/share/wwwconfig-common/apache-uninclude_all.sh ] ; then
32                                         . /usr/share/wwwconfig-common/apache-uninclude_all.sh
33                                         if [ "$status" = "purge" ] ; then
34                                                 restart="$restart $server"
35                                         fi
36                                 else
37                                         echo "Can not unconfigure gosa from apache because wwwconfig-common is removed."
38                                 fi
39                         ;;
41                         remove)
42                                 if [ -e /usr/share/wwwconfig-common/apache-cominclude_all.sh ] ; then
43                                         . /usr/share/wwwconfig-common/apache-cominclude_all.sh
44                                         if [ "$status" = "comment" ] ; then
45                                                 restart="$restart $server"
46                                         fi
47                                 else
48                                         echo "Can not unconfigure imp from apache because wwwconfig-common is removed."
49                                 fi
50                         ;;
51                 esac
52         done
53         
54         # Restart servers
55         /usr/share/wwwconfig-common/restart.sh
57     ;;
58     upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
60     ;;
62     *)
63         echo "postrm called with unknown argument \`$1'" >&2
64         exit 0
65     ;;
66 esac
68 #DEBHELPER#
70 exit 0