root/alternc-mailman/tags/1.4.10/debian/postrm

Revision 1239, 1.3 kB (checked in by lunar, 3 years ago)

r90@sud: lunar | 2006-03-11 15:24:41 +0100
Fix configure/unconfigure functions in postinst/postrm scripts

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/bin/sh -e
2
3 CONFIGFILE="/etc/alternc/local.sh"
4 MENUFILE="/etc/alternc/menulist.txt"
5
6 # Remove mailman aliases to the apache configuration file given as argument
7 function unconfigure {
8     if grep -Eqs "\*\*\*MAILMAN\*\*\*" $1; then
9         cp -a -f $1 $1.alternc_mailman
10         cat $1 | grep -v "\*\*\*MAILMAN\*\*\*" |
11             grep -v "   Alias /marchives/ /var/lib/mailman/archives/public/" |
12             grep -v "Alias /mimages/ /usr/share/images/mailman/" \
13             > $1.alternc_mailman
14         mv -f $1.alternc_mailman $1
15     fi
16 }
17
18 case "$1" in
19   remove)
20     # Remove Mailman references from Apache configuration
21     unconfigure /etc/alternc/templates/apache/httpd.conf
22     unconfigure /etc/alternc/templates/apache-ssl/httpd.conf
23     alternc.install
24
25     rm -f /var/alternc/cgi-bin/mailman
26
27     if grep -qs "menu_mailman.php" $MENUFILE; then
28         rm -f $MENUFILE.alternc_mailman
29         cat $MENUFILE | grep -v "menu_mailman.php" >$MENUFILE.alternc_mailman
30         mv -f $MENUFILE.alternc_mailman $MENUFILE
31     fi
32     ;;
33   purge)
34     if [ -e "$CONFIGFILE" -a -x "/usr/bin/mysql" ]; then
35         . "$CONFIGFILE"
36         mysql -f -u"$MYSQL_USER" -p"$MYSQL_PASS" -h"$MYSQL_HOST" \
37               "$MYSQL_DATABASE" -e "DROP TABLE IF EXISTS mailman"
38     fi
39     ;;
40 esac
41
42 # dh_installdeb will replace this with shell code automatically
43 # generated by other debhelper scripts.
44 #DEBHELPER#
45
Note: See TracBrowser for help on using the browser.