source: alternc-webalizer/trunk/debian/postrm @ 2430

Revision 2430, 852 bytes checked in by anarcat, 5 years ago (diff)

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
3CONFIGFILE="/etc/alternc/local.sh"
4MENUFILE="/etc/alternc/menulist.txt"
5
6case "$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    ;;
26esac
27
28# dh_installdeb will replace this with shell code automatically
29# generated by other debhelper scripts.
30#DEBHELPER#
Note: See TracBrowser for help on using the repository browser.