2014-02-23 | Paul Boddie | file changeset files shortlog | Packaging for chwala 0.2-0~kolab6 from upstream. |
paul@0 | 1 | #!/bin/sh |
paul@0 | 2 | |
paul@0 | 3 | set -e |
paul@0 | 4 | |
paul@0 | 5 | fixperms() { |
paul@0 | 6 | chown -R www-data:adm \ |
paul@0 | 7 | /var/cache/chwala \ |
paul@0 | 8 | /var/lib/chwala \ |
paul@0 | 9 | /var/log/chwala |
paul@0 | 10 | chmod 750 \ |
paul@0 | 11 | /var/cache/chwala \ |
paul@0 | 12 | /var/lib/chwala \ |
paul@0 | 13 | /var/log/chwala |
paul@0 | 14 | } |
paul@0 | 15 | |
paul@0 | 16 | reload_apache() |
paul@0 | 17 | { |
paul@0 | 18 | if apache2ctl configtest 2>/dev/null; then |
paul@0 | 19 | invoke-rc.d apache2 $1 || true |
paul@0 | 20 | else |
paul@0 | 21 | echo "Your apache2 configuration is broken, so we're not restarting it for you." |
paul@0 | 22 | fi |
paul@0 | 23 | } |
paul@0 | 24 | |
paul@0 | 25 | |
paul@0 | 26 | case "$1" in |
paul@0 | 27 | configure) |
paul@0 | 28 | fixperms |
paul@0 | 29 | a2enmod rewrite >/dev/null 2>&1 || true |
paul@0 | 30 | if [ -e "/etc/apache2/sites-available/chwala" -a ! -e "/etc/apache2/sites-enabled/chwala" ]; then |
paul@0 | 31 | a2ensite chwala |
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 |