source: trunk/debian/postinst @ 1075

Revision 1075, 1.5 KB checked in by benjamin, 7 years ago (diff)

correcting postinst mailman scories

  • 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
2
3set -e
4
5CONFIGFILE="/etc/alternc/local.sh"
6MENUFILE="/etc/alternc/menulist.txt"
7
8# Add awstats include to the apache configuration file given as argument
9function configure {
10    if ! grep -Eq "\*\*\*AWSTATS\*\*\*" $1; then
11        cp -a -f $1 $1.tmp
12        sed -e "s/\*\*\*ALTERNC_ALIASES\*\*\*/&\\
13            # ***AWSTATS*** \\
14        Include \"\/etc\/apache\/alternc-awstats.conf\"/" < $1 > $1.tmp
15        mv -f $1.tmp $1
16    fi
17}
18
19
20case "$1" in
21  configure)
22    . "$CONFIGFILE"
23
24    echo "Installing mysql table"
25    mysql -h"$MYSQL_HOST" -p"$MYSQL_PASS" -u"$MYSQL_USER" "$MYSQL_DATABASE" \
26        </usr/share/alternc/awstats.sql || true
27   
28    # Refresh apache configuration
29    configure /etc/alternc/templates/apache/httpd.conf
30    configure /etc/alternc/templates/apache-ssl/httpd.conf
31    ln /usr/lib/cgi-bin/awstats.pl /var/alternc/cgi-bin/ -sf
32    alternc.install
33
34    # Process the language compilation.
35    /usr/share/alternc/install/dopo.sh
36
37    # ADD Mailman menu item :
38    if ! grep -q "^menu_aws.php$" "$MENUFILE"; then
39        rm -f $MENUFILE.alternc_awstats
40        sed -e "s/menu_brouteur.php/&\\
41menu_aws.php/" <$MENUFILE >$MENUFILE.alternc_awstats
42        mv -f $MENUFILE.alternc_awstats $MENUFILE
43    fi
44    ;;
45
46  abort-upgrade|abort-remove|abort-deconfigure)
47    ;;
48
49  *)
50    echo "postinst called with unknown argument \`$1'" >&2
51    exit 1
52    ;;
53esac
54
55# dh_installdeb will replace this with shell code automatically
56# generated by other debhelper scripts.
57#DEBHELPER#
58
59# vim: et sw=4
Note: See TracBrowser for help on using the repository browser.