Merge branch 'upstream'
[rahunas] / debian / rahunas-weblogin.postinst
1 #!/bin/sh
2
3 set -e
4
5 #
6 # Skip, if we are not in "configure" state
7 #
8 if [ "$1" != "configure" ]; then
9   exit 0
10 fi
11
12 ucf /usr/share/doc/rahunas-weblogin/rahunas-weblogin.apache2.conf \
13   /etc/rahunas/apache2.conf
14
15 if which a2enmod > /dev/null 2>&1; then
16   a2enmod ssl > /dev/null 2>&1
17   a2enmod rewrite > /dev/null 2>&1
18 fi
19
20 if [ -d "/etc/apache2/conf.d" ]; then
21   if [ ! -e "/etc/apache2/conf.d/rahunas.conf" ]; then
22     ln -s /etc/rahunas/apache2.conf /etc/apache2/conf.d/rahunas.conf
23   fi
24   invoke-rc.d apache2 reload || true;
25 fi
26
27 if [ ! -f /usr/share/rahunas/config.php ]; then
28   if [ -f "/etc/rahunas/config.php" ]; then 
29     ln -s /etc/rahunas/config.php /usr/share/rahunas/config.php 
30   fi
31 fi
32
33 if which pear > /dev/null 2>&1; then
34   echo "Installing required PEAR packages.."
35   echo "Installing Auth_RADIUS package"
36   pear install Auth_RADIUS > /dev/null 2>&1 || true
37   echo "Installing Crypt_CHAP package"
38   pear install Crypt_CHAP > /dev/null 2>&1 || true
39   echo "Installing Cache_Lite package"
40   pear install Cache_Lite > /dev/null 2>&1 || true
41   echo "Installing XML_RPC2 package"
42   pear install XML_RPC2 > /dev/null 2>&1 || true
43   echo "Done.."
44 fi
45
46 #DEBHELPER#
47 exit 0