Kolab/kolab-webadmin

Annotated debian/postinst

3:4ff966d017f3
2014-02-22 Paul Boddie Merged upstream changes. paul
paul@0 1
#!/bin/sh
paul@0 2
paul@0 3
set -e
paul@0 4
paul@0 5
#EXTRA#
paul@0 6
#DEBHELPER#
paul@0 7
paul@0 8
fixperms() {
paul@0 9
    chown -R www-data:www-data \
paul@0 10
        /var/cache/kolab-webadmin \
paul@0 11
        /var/log/kolab-webadmin
paul@0 12
    chmod 750 \
paul@0 13
        /var/cache/kolab-webadmin \
paul@0 14
        /var/log/kolab-webadmin
paul@0 15
}
paul@0 16
paul@0 17
reload_apache()
paul@0 18
{
paul@0 19
    if apache2ctl configtest 2>/dev/null; then
paul@0 20
        invoke-rc.d apache2 $1 || true
paul@0 21
    else
paul@0 22
        echo "Your apache2 configuration is broken, so we're not restarting it for you."
paul@0 23
    fi
paul@0 24
}
paul@0 25
paul@0 26
paul@0 27
case "$1" in
paul@0 28
    configure)
paul@0 29
        fixperms
paul@1 30
        setup-kolab mysql --use-system-config
paul@0 31
        a2enmod rewrite > /dev/null || true
paul@0 32
        if [ -e "/etc/apache2/sites-available/kolab-webadmin" -a ! -e "/etc/apache2/sites-enabled/kolab-webadmin" ]; then
paul@0 33
            a2ensite kolab-webadmin > /dev/null || true
paul@0 34
        fi
paul@0 35
        reload_apache reload
paul@0 36
    ;;
paul@0 37
esac
paul@0 38
paul@0 39
exit 0