source: trunk/debian/postinst @ 1460

Revision 1460, 1.2 KB checked in by anonymous, 9 years ago (diff)

add DEBHELPER hook
set permissions on /etc/webalizer in postinst instead of alternc-install

  • 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# Debian alternc-webalizer postinst
4# Benjamin Sonntag <benjamin@alternc.org>
5
6# Uses debconf
7. /usr/share/debconf/confmodule
8# Uses AlternC.conf
9if [ -x /etc/alternc/local.sh ] 
10then
11    . /etc/alternc/local.sh
12fi
13
14case "$1" in
15configure)
16
17    # 1st, configure the table if required
18    mysql -h"$MYSQL_HOST" -p"$MYSQL_PASS" -u"$MYSQL_USER" "$MYSQL_DATABASE" </usr/share/alternc/webalizer.sql
19
20    # Then, configure the quota for "stats"
21    db_get alternc-webalizer/quota_create_ask
22    /usr/share/alternc/quota_init stats $RET
23
24    # Compile the po files :
25    /usr/lib/alternc/dopo.sh
26
27    # that's not very nice, but we need it
28    chown www-data /etc/webalizer
29
30    # Finally, add this module to the AlternC's menu :
31    if [ -z `grep menu_stats.php /var/alternc/bureau/admin/menulist.txt` ] 
32    then
33        echo "menu_stats.php" >>/var/alternc/bureau/admin/menulist.txt
34    fi
35
36    ;;
37
38abort-upgrade)
39    exit 0
40    ;;
41
42abort-remove|abort-deconfigure)
43    exit 0
44    ;;
45
46*)
47    echo "postinst called with unknown argument '$1'" >&2
48    exit 1
49    ;;
50esac
51
52# dh_installdeb will replace this with shell code automatically
53# generated by other debhelper scripts.
54
55#DEBHELPER#
56
57exit 0
Note: See TracBrowser for help on using the repository browser.