Code

Updated create check
[gosa.git] / gosa-core / debian / gosa.postinst
1 #!/bin/sh
2 # postinst script for gosa
3 #
4 # see: dh_installdeb(1)
6 set -e
8 case "$1" in
9   configure)
10       ;;
12   abort-upgrade|abort-remove|abort-deconfigure)
13       ;;
15   *)
16       echo "postinst called with unknown argument \`$1'" >&2
17       exit 1
18       ;;
19 esac
21 #DEBHELPER#
23 # Set ID's
24 WEBUSER="www-data"
25 WEBGROUP="www-data"
27 # Create empty inclusion file for apache
28 if [ ! -f /etc/gosa/gosa.secrets ]; then
29     touch /etc/gosa/gosa.secrets
30     chmod 600 /etc/gosa/gosa.secrets
31 fi
33 # Copy GOsa configuration to conf.d directories
34 if [ ! -L /etc/apache2/conf.d/gosa.conf ]; then
35   echo "Making /gosa available in /etc/apache2/conf.d"
37   # Add GOsa include file
38   ln -s /etc/gosa/gosa-apache.conf /etc/apache2/conf.d/gosa.conf
39 fi
41 # Add links for safe mode
42 [ ! -d /usr/share/gosa/bin ] && mkdir -p /usr/share/gosa/bin
43 for source in /usr/bin/convert /usr/bin/lpstat; do
44   if [ -e $source ]; then
45     target=/usr/share/gosa/bin/${source##*/}
46     [ ! -L $target ] && ln -sf $source $target
47   fi
48 done
50 # Fix permission in /var/(spool|cache)/gosa
51 chown root.$WEBGROUP -R /var/spool/gosa
52 chmod 770 -R /var/spool/gosa
53 chown root.$WEBGROUP -R /var/cache/gosa
54 chmod 770 -R /var/cache/gosa
56 # Add support for RequestHeader
57 a2enmod headers
59 # Update gosa
60 /usr/sbin/update-gosa
62 # Finally restart servers
63 if [ -x /usr/sbin/invoke-rc.d ]; then
64   invoke-rc.d apache2 reload
65 else
66   /etc/init.d/apache2 reload
67 fi
69 exit 0