#!/bin/sh MIRROR_DIR="/net/mirror" HTTP_DIR="/var/www/mirror" DEFAULT_CONF="llx1505.conf" HTTP_ADMIN_DIR="/var/www/lliurex-mirror" case $1 in configure) # Configuration files for f in $(ls -1 /usr/share/lliurex-mirror/conf-templates/*.conf); do echo "Copying $f to /etc/lliurex-mirror/conf/" cp -f $f /etc/lliurex-mirror/conf/ done # Default setting if [ ! -e /etc/lliurex-mirror/conf/default.conf ]; then echo "No default set, linking default" ln -s /etc/lliurex-mirror/conf/${DEFAULT_CONF} /etc/lliurex-mirror/conf/default.conf fi if dpkg --compare-versions "$2" lt 20.1; then echo "The Murciapocalypse" find ${MIRROR_DIR} -type d -exec chmod 0755 {} \; || true find ${MIRROR_DIR} -type f -exec chmod 0644 {} \; || true fi lliurex-mirror do_sanity_checks sleep 1 rm -f $HTTP_DIR ln -s "$MIRROR_DIR" "$HTTP_DIR" if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then . /usr/share/apache2/apache2-maintscript-helper apache2_invoke ensite mirror apache2_invoke ensite lliurex-mirror fi rm -f $HTTP_ADMIN_DIR ln -s /usr/share/lliurex-mirror/lliurex-mirror $HTTP_ADMIN_DIR if [ -e /etc/apache2/sites-available/lliurex-mirror-redirect ]; then if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then . /usr/share/apache2/apache2-maintscript-helper apache2_invoke dissite lliurex-mirror-redirect fi rm -rf /etc/apache2/sites-available/lliurex-mirror-redirect || true fi invoke-rc.d apache2 reload || true n4d-modules enable-plugin /etc/n4d/conf.d/LliurexMirrorCore || true ;; *) echo "Nothing to do" ;; esac #DEBHELPER#