root/alternc-awstats/tags/REL_0_3/debian/postinst

Revision 1063, 2.3 kB (checked in by anonymous, 4 years ago)

This commit was manufactured by cvs2svn to create tag 'REL_0_3'.

  • 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-awstats postinst
4 # Benjamin Sonntag <benjamin@alternc.org>
5
6 # Cette fonction regarde si un fichier de config ($1) a déjà reçu une modif
7 # de config, et sinon, lui ajoute la ligne voulue là où la balise le demande.
8 function configure {
9     if grep -vqs "\*\*\*AWSTATS\*\*\*" $1
10         then
11         # 1. on déplace le fichier
12         rm -f $1.alternc_awstats
13         sed -e "s/\*\*\*ALTERNC_ALIASES\*\*\*/&\\
14         # ***AWSTATS*** \\
15         Include \"\/etc\/apache\/alternc-awstats.conf\"/" <$1 >$1.alternc_awstats
16         mv -f $1.alternc_awstats $1
17     fi
18 }
19
20
21 # Uses debconf
22 . /usr/share/debconf/confmodule
23 # Uses AlternC.conf
24 if [ -e /etc/alternc/local.sh ]
25 then
26     . /etc/alternc/local.sh
27 fi
28
29 case "$1" in
30 configure)
31         ## for older alternc version
32     if [ -z "$MYSQL_HOST" ]
33         then
34         MYSQL_HOST="localhost"
35     fi
36     # 1st, configure the table if required
37     mysql -h"$MYSQL_HOST" -p"$MYSQL_PASS" -u"$MYSQL_USER" "$MYSQL_DATABASE" </usr/share/alternc/awstats.sql || true
38
39     # Then, configure the quota for "stats"
40     RET="2"
41     db_get alternc-awstats/default_quota_value
42     /usr/lib/alternc/quota_init aws $RET
43
44     # Compile the po files :
45     echo "Configuring apache"
46     configure /etc/apache/httpd.conf
47     configure /usr/share/alternc/1.0/install/etc/apache-ssl/httpd.conf
48     echo "Configuring apache-ssl"
49     configure /etc/apache-ssl/httpd.conf
50     configure /usr/share/alternc/1.0/install/etc/apache/httpd.conf
51     /usr/share/alternc/install/dopo.sh || true
52     /etc/init.d/apache reload || true
53     ln /usr/lib/cgi-bin/awstats.pl /var/alternc/cgi-bin/ -sf
54
55     # that's not very nice, but we need it
56     chown www-data /etc/awstats /var/cache/awstats
57     touch /etc/alternc/awstats.htpasswd
58     chown 33 /etc/alternc/awstats.htpasswd
59     chmod 777 /etc/alternc/awstats.htpasswd
60
61     # Finally, add this module to the AlternC's menu :
62     if [ -z `grep menu_aws.php /var/alternc/bureau/admin/menulist.txt` ]
63     then
64         echo "menu_aws.php" >>/var/alternc/bureau/admin/menulist.txt
65         echo "you may move menu_aws.php to a better place in /var/alternc/bureau/admin/menulist.txt"
66     fi
67
68     ;;
69
70 abort-upgrade)
71     exit 0
72     ;;
73
74 abort-remove|abort-deconfigure)
75     exit 0
76     ;;
77
78 *)
79     echo "postinst called with unknown argument '$1'" >&2
80     exit 1
81     ;;
82 esac
83
84 # dh_installdeb will replace this with shell code automatically
85 # generated by other debhelper scripts.
86
87 #DEBHELPER#
88
89 exit 0
Note: See TracBrowser for help on using the browser.