Kolab/kolab-freebusy

Annotated debian/postinst

4:30dafda6223e
2014-08-16 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:adm \
paul@0 10
        /var/log/kolab-freebusy
paul@0 11
    chmod 750 \
paul@0 12
        /var/log/kolab-freebusy
paul@0 13
}
paul@0 14
paul@0 15
reload_apache()
paul@0 16
{
paul@0 17
    if apache2ctl configtest 2>/dev/null; then
paul@0 18
        invoke-rc.d apache2 $1 || true
paul@0 19
    else
paul@0 20
        echo "Your apache2 configuration is broken, so we're not restarting it for you."
paul@0 21
    fi
paul@0 22
}
paul@0 23
paul@0 24
paul@0 25
case "$1" in
paul@0 26
    configure)
paul@0 27
        fixperms
paul@1 28
        setup-kolab freebusy --use-system-config
paul@0 29
        a2enmod rewrite >/dev/null 2>&1 || true
paul@0 30
        if [ -e "/etc/apache2/sites-available/kolab-freebusy" -a ! -e "/etc/apache2/sites-enabled/kolab-freebusy" ]; then
paul@0 31
            a2ensite kolab-freebusy
paul@0 32
        fi
paul@0 33
        reload_apache reload
paul@0 34
    ;;
paul@0 35
esac
paul@0 36
paul@0 37
exit 0