2006-10-19 16:55:07 +02:00
|
|
|
#! /bin/sh
|
|
|
|
# postinst script for livesupport
|
|
|
|
#
|
|
|
|
# see: dh_installdeb(1)
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# summary of how this script can be called:
|
|
|
|
# * <postinst> `configure' <most-recently-configured-version>
|
|
|
|
# * <old-postinst> `abort-upgrade' <new version>
|
|
|
|
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
|
|
|
# <new-version>
|
|
|
|
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
|
|
|
# <failed-install-package> <version> `removing'
|
|
|
|
# <conflicting-package> <version>
|
|
|
|
# for details, see http://www.debian.org/doc/debian-policy/ or
|
|
|
|
# the debian-policy package
|
|
|
|
#
|
|
|
|
|
2006-11-19 18:22:58 +01:00
|
|
|
installdir=/opt/campcaster
|
2007-09-20 12:24:42 +02:00
|
|
|
apache_docroot=/var/www
|
|
|
|
apache_group=www-data
|
|
|
|
|
|
|
|
if [ -d /etc/postgresql/8.1 ]; then
|
|
|
|
postgresql_dir=/etc/postgresql/8.1/main
|
|
|
|
postgresql_init_script=/etc/init.d/postgresql-8.1
|
|
|
|
elif [ -d /etc/postgresql/8.2 ]; then
|
|
|
|
postgresql_dir=/etc/postgresql/8.2/main
|
|
|
|
postgresql_init_script=/etc/init.d/postgresql-8.2
|
2008-05-19 15:54:51 +02:00
|
|
|
elif [ -d /etc/postgresql/8.3 ]; then
|
|
|
|
postgresql_dir=/etc/postgresql/8.3/main
|
|
|
|
postgresql_init_script=/etc/init.d/postgresql-8.3
|
2007-09-20 12:24:42 +02:00
|
|
|
else
|
2008-05-19 15:54:51 +02:00
|
|
|
echo "no postgresql 8.1, 8.2 or 8.3 found" >&2
|
2007-09-20 12:24:42 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2006-10-19 16:55:07 +02:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure)
|
|
|
|
# do post-installation configuration
|
2006-11-19 18:22:58 +01:00
|
|
|
$installdir/bin/postInstallStation.sh --directory=$installdir \
|
2007-09-20 12:24:42 +02:00
|
|
|
--apache-group=$apache_group \
|
|
|
|
--postgresql-dir=$postgresql_dir \
|
|
|
|
--postgresql-init-script=$postgresql_init_script
|
2006-10-19 16:55:07 +02:00
|
|
|
|
2007-02-06 19:06:34 +01:00
|
|
|
# remount the NFS share if we have a 2-computer setup
|
|
|
|
if [ -f $installdir/storageServer.wasMounted ]; then
|
2007-02-07 11:44:23 +01:00
|
|
|
echo "Remounting the remote storage..."
|
2007-02-06 19:06:34 +01:00
|
|
|
mount $installdir/var/Campcaster/storageServer
|
|
|
|
rm $installdir/storageServer.wasMounted
|
|
|
|
fi
|
|
|
|
|
2006-12-01 13:59:22 +01:00
|
|
|
# register and start the Campcaster scheduler daemon
|
2006-11-23 19:20:43 +01:00
|
|
|
cp -f $installdir/etc/campcaster-scheduler /etc/init.d
|
2006-11-19 18:22:58 +01:00
|
|
|
update-rc.d campcaster-scheduler defaults 92 || true
|
|
|
|
/etc/init.d/campcaster-scheduler start || true
|
2006-10-19 16:55:07 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|