nuages.postinst 877 Bytes
Newer Older
chris's avatar
chris committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh
set -e

case "$1" in
    configure)
    # Create the secret key
    if [ ! -f /var/lib/nuages/key ]; then
        pwgen -s -y 50 > /var/lib/nuages/key
        chmod 640 /var/lib/nuages/key
    fi

    # Sync dthe database and collect the static files
    nuages syncdb -v 0 --noinput
chris's avatar
chris committed
14
    nuages migrate meetingpoll -v 0 --noinput
chris's avatar
chris committed
15 16 17 18 19 20 21 22
    nuages collectstatic -v 0 --noinput

    chown -R www-data /var/lib/nuages

    # Adapt apache virtual host
    export DOMAIN=`hostname -d`
    sed "s/localdomain/${DOMAIN}/g" -i /etc/apache2/sites-available/nuages.conf
    sed "s/localdomain/${DOMAIN}/g" -i /etc/apache2/sites-available/nuages-ssl.conf
23
    [ -z "`grep -r nuages /etc/apache2/sites-enabled/*`" ] && ln -sf /etc/apache2/sites-available/nuages.conf /etc/apache2/sites-enabled/nuages.conf
chris's avatar
chris committed
24 25 26 27 28 29 30 31 32
    echo "You may need to configure apache."
    ;;
esac

#DEBHELPER#

exit 0