#!/bin/sh set -e VARMOODLE='/var/lib/moodle2' SITE_DIR="/var/www/lliurex/moodle" LLXCFG_MOODLE_DIR="/usr/share/lliurex/llxcfg-moodle" HOOKS_N4D="/usr/share/lliurex-moodle2/n4d/hooks/" N4D_DIR="/usr/share/n4d/hooks/" # --------- case "$1" in configure) # moodle site link if [ ! -d $SITE_DIR ] ; then ln -s $LLXCFG_MOODLE_DIR $SITE_DIR fi chown www-data:www-data $VARMOODLE || true ln -sf /etc/moodle/apache.conf /etc/apache2/conf.d/moodle || true AUXPATH=`mktemp` CRONORDER="*/5 * * * * /usr/sbin/llxcfg-moodle-cron" CRONPARSED="\/usr\/sbin\/llxcfg-moodle-cron" crontab -u www-data -l > $AUXPATH || true sed -i "/$CRONPARSED\$/d" $AUXPATH echo "$CRONORDER" >> $AUXPATH crontab -u www-data $AUXPATH rm $AUXPATH || true for x in $(find $HOOKS_N4D -xtype f); do AUX=$(echo $x | sed -e "s%$HOOKS_N4D%%g") if [ -f "$N4D_DIR$AUX" ]; then cp "$x" "$N4D_DIR$AUX" fi done ;; esac #DEBHELPER# exit 0