#! /bin/sh -e # postinst script for moodle get_config() { webserver="apache2" } case "$1" in configure) # Read debconf and edit the config file accordingly get_config # Care about the repository repository=/var/lib/moodle if [ -d $repository ]; then # set the owner and change rights accordingly chown -R www-data:www-data $repository chmod 0755 $repository fi ln -sf /etc/moodle/apache.conf /etc/${webserver}/conf.d/moodle chown www-data:www-data /etc/moodle/config.php chmod 640 /etc/moodle/config.php invoke-rc.d ${webserver} reload || true ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0