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