#!/bin/sh 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 echo "Create the www-data user in Postgres and the dotlrn database." su - postgres "dropuser www-data" su - postgres "dropdb dotlrn" su - postgres "createuser -a -d www-data" 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 "Saving default aolserver and postgresql config in /usr/share/doc/dotlrn/default-etc." cp -p /etc/init.d/aolserver4 /usr/share/doc/dotlrn/default-etc/init.d/ cp -p /etc/aolserver4/aolserver4.tcl /usr/share/doc/dotlrn/default-etc/aolserver4/ cp -p /etc/postgresql/postgresql.conf /usr/share/doc/dotlrn/default-etc/postgresql/ cp -p /etc/postgresql/pg_hba.conf /usr/share/doc/dotlrn/default-etc/postgresql/ echo "Overriding default aolserver and postgresql config." cp -p /usr/share/doc/dotlrn/etc/init.d/aolserver4 /etc/init.d/ cp -p /usr/share/doc/dotlrn/etc/aolserver4/aolserver4.tcl /etc/aolserver4/ cp -p /usr/share/doc/dotlrn/etc/postgresql/postgresql.conf /etc/postgresql/ cp -p /usr/share/doc/dotlrn/etc/postgresql/pg_hba.conf /etc/postgresql/ echo "Restarting postgresql" /etc/init.d/postgresql restart echo "Restarting aolserver" /etc/init.d/aolserver4 restart