6253N/A#!/bin/bash
6238N/Aset -e
6238N/A# Post install script
6253N/A# Install is launched with an empty second arg.
6253N/A# If the package is already installed,
6253N/A# the second arg. is not empty.
6253N/A# In this case, we are in upgrade mode.
6253N/Aif [ "$1" = "configure" ] && [ ! -z "$2" ]
6253N/Athen
6253N/A# For being secure, we check the buildinfo file too.
6253N/A if [ -f @prefix@/config/buildinfo ]
6253N/A then
6253N/A echo *Starting upgrade...
6330N/A @prefix@/upgrade -n --acceptLicense
6253N/A echo
6253N/A# Upgrade fails - Requires mandatory user interaction.
6279N/A# Nevertheless, exits successfully of the pkg process.
6253N/A if [ "$?" -eq 2 ]
6253N/A then
6253N/A exit 0
6253N/A fi
6279N/A# Restarts the service if needed.
6279N/A# If server is stopped by upgrade process,
6279N/A# the server will restart after upgrade.
6253N/A# If server is stopped before the upgrade process
6253N/A# (eg. upgrade the new package), the server will not restart.
6253N/A# Uses the flag for determining server status at this point.
6253N/A if [ "$?" -eq 0 ]
6253N/A then
6253N/A if [ -f @prefix@/logs/status ]
6253N/A then
6253N/A echo
6253N/A echo "*Restarting server..."
6330N/A @prefix@/bin/start-ds
6253N/A rm -f @prefix@/logs/status
6253N/A fi
6253N/A fi
6253N/A else
6253N/A# Invalid installation, could not find the buildinfo file.
6294N/A echo "Invalid installation, could not find the build info file."
6294N/A exit -1
6253N/A fi
6253N/Afi
6238N/A# End post install script
6238N/Aecho