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