#!/bin/sh #--------------config DOTLRN_USER=dotlrn echo "Shutting down aolserver" /etc/init.d/aolserver4 stop # make sure nsd is really gone pkill nsd echo "Remove the dummy files from debian's stock aolserver installation" rm -rf /var/www/index.html /var/www/icons if ! grep -q ^$DOTLRN_USER /etc/passwd; then echo "Adding $DOTLRN_USER user and group" adduser --system --group $DOTLRN_USER fi chown -R dotlrn:dotlrn /var/www/* echo "(Re)create the $DOTLRN_USER user in Postgres and the dotlrn database." su - postgres "dropuser dotlrn" su - postgres "dropdb dotlrn" su - postgres "createuser -a -d dotlrn" su - postgres "createdb -E UNICODE dotlrn" su - postgres "createlang plpgsql dotlrn" echo "Adding vacummdb analyze jobs for dotlrn database to postgres' crontab" su - postgres "crontab -l > /tmp/pgcrontab.$$; \ echo @hourly /usr/local/pgsql/bin/vacuumdb --analyze dotlrn >>/tmp/pgcrontab.$$; \ echo @daily /usr/local/pgsql/bin/vacuumdb --full --analyze dotlrn >>/tmp/pgcrontab.$$; \ crontab /tmp/pgcrontab.$$; \ rm /tmp/pgcrontab.$$;" echo "Restarting postgresql" /etc/init.d/postgresql restart echo "Restarting aolserver" /etc/init.d/dotlrn restart