diff --git a/campcaster/etc/debian/campcaster-station.postinst b/campcaster/etc/debian/campcaster-station.postinst index 0dba7d830..55f17467b 100644 --- a/campcaster/etc/debian/campcaster-station.postinst +++ b/campcaster/etc/debian/campcaster-station.postinst @@ -21,23 +21,18 @@ installdir=/opt/campcaster case "$1" in configure) - if [ -f $installdir/storageServer.wasMounted ]; then - storagedir=$installdir/var/Campcaster/storageServer - if [ -d $storagedir.bak ]; then - rm -rf $storagedir.bak - fi - mv -f $storagedir $storagedir.bak - mkdir $storagedir - mount $storagedir - rm $installdir/storageServer.wasMounted - fi - # do post-installation configuration $installdir/bin/postInstallStation.sh --directory=$installdir \ --apache-group=www-data \ --postgresql-dir=/etc/postgresql/8.1/main \ --postgresql-init-script=/etc/init.d/postgresql-8.1 + # remount the NFS share if we have a 2-computer setup + if [ -f $installdir/storageServer.wasMounted ]; then + mount $installdir/var/Campcaster/storageServer + rm $installdir/storageServer.wasMounted + fi + # register and start the Campcaster scheduler daemon cp -f $installdir/etc/campcaster-scheduler /etc/init.d update-rc.d campcaster-scheduler defaults 92 || true diff --git a/campcaster/etc/debian/campcaster-station.postrm b/campcaster/etc/debian/campcaster-station.postrm index 1f08bff69..ed7ce62f2 100644 --- a/campcaster/etc/debian/campcaster-station.postrm +++ b/campcaster/etc/debian/campcaster-station.postrm @@ -68,13 +68,8 @@ case "$1" in # remove generated files rm -rf $installdir/var/Campcaster/archiveServer/var/stor/* - - storagedir=$installdir/var/Campcaster/storageServer - if [ -f $installdir/storageServer.wasMounted ]; then - rmdir $storagedir - else - rm -rf $storagedir/var/stor/* - fi + rm -rf $installdir/var/Campcaster/storageServer/var/stor/* + rm -f $installdir/storageServer.wasMounted ;; *) diff --git a/campcaster/etc/debian/campcaster-station.prerm b/campcaster/etc/debian/campcaster-station.prerm index c33f4e8d3..425fd5e0e 100644 --- a/campcaster/etc/debian/campcaster-station.prerm +++ b/campcaster/etc/debian/campcaster-station.prerm @@ -45,6 +45,13 @@ check_exe() { case "$1" in remove|upgrade|deconfigure) + # unmount the NFS share, if we have a 2-computer setup + storagedir=$installdir/var/Campcaster/storageServer + if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then + umount $storagedir + touch $installdir/storageServer.wasMounted + fi + # stop the livesupport scheduler daemon /etc/init.d/campcaster-scheduler stop || true /etc/init.d/campcaster-scheduler kill || true @@ -78,15 +85,8 @@ case "$1" in rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/* rm -rf $installdir/var/Campcaster/archiveServer/var/access/* rm -rf $installdir/var/Campcaster/archiveServer/var/trans/* - - storagedir=$installdir/var/Campcaster/storageServer - if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then - umount $storagedir - touch $installdir/storageServer.wasMounted - else - rm -rf $storagedir/var/access/* - rm -rf $storagedir/var/trans/* - fi + rm -rf $installdir/var/Campcaster/storageServer/var/access/* + rm -rf $installdir/var/Campcaster/storageServer/var/trans/* ;; failed-upgrade)