root/alternc-webalizer/trunk/debian/postrm

Revision 2430, 0.8 kB (checked in by anarcat, 1 month ago)

remove generated webalizer.conf configuration file on purge

Closes: #1159

  • 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 case "$1" in
7   remove)
8
9     if grep -qs "menu_webalizer.php" $MENUFILE; then
10         rm -f $MENUFILE.alternc_webalizer
11         cat $MENUFILE | grep -v "menu_webalizer.php" >$MENUFILE.alternc_webalizer
12         mv -f $MENUFILE.alternc_webalizer $MENUFILE
13     fi
14     ;;
15   purge)
16     /usr/lib/alternc/quota_delete stats || true
17     if [ -e "$CONFIGFILE" -a -x "/usr/bin/mysql" ]; then
18         . "$CONFIGFILE"
19         mysql -f --defaults-file=/etc/alternc/my.cnf -e "DROP TABLE IF EXISTS stats;"
20     fi
21     rm -rf /var/cache/webalizer
22     # potentially generated configuration files, usually by other
23     # packages
24     rm -f /etc/alternc/webalizer.conf
25     ;;
26 esac
27
28 # dh_installdeb will replace this with shell code automatically
29 # generated by other debhelper scripts.
30 #DEBHELPER#
31
Note: See TracBrowser for help on using the browser.