preinst revision 054848749d97535e9e1d5da4504079ac684f141b
1cd2872b696c4bdfb7694da53883d02de3360e12violette#!/bin/bash
a5b9f8fb834b1b2208e59a2fa76714bd91a5f147violetteset -e
1cd2872b696c4bdfb7694da53883d02de3360e12violette# Pre installation script
1cd2872b696c4bdfb7694da53883d02de3360e12violetteif [ "$1" = "upgrade" ]
1cd2872b696c4bdfb7694da53883d02de3360e12violettethen
054848749d97535e9e1d5da4504079ac684f141bviolette# Only if the instance has been configured
054848749d97535e9e1d5da4504079ac684f141bviolette if [ -f @prefix@/config/buildinfo ] && [ "$(ls -A @prefix@/config/archived-configs)" ]
1cd2872b696c4bdfb7694da53883d02de3360e12violette then
054848749d97535e9e1d5da4504079ac684f141bviolette# If the server is running before upgrade, creates a flag.
054848749d97535e9e1d5da4504079ac684f141bviolette if [ -f @prefix@/logs/server.pid ]
054848749d97535e9e1d5da4504079ac684f141bviolette then
054848749d97535e9e1d5da4504079ac684f141bviolette touch @prefix@/logs/status
054848749d97535e9e1d5da4504079ac684f141bviolette fi
054848749d97535e9e1d5da4504079ac684f141bviolette echo *Stopping OpenDJ server...
054848749d97535e9e1d5da4504079ac684f141bviolette @prefix@/bin/./stop-ds
054848749d97535e9e1d5da4504079ac684f141bviolette else
054848749d97535e9e1d5da4504079ac684f141bviolette echo "Instance is not configured. Upgrade aborded."
054848749d97535e9e1d5da4504079ac684f141bviolette exit -1
1cd2872b696c4bdfb7694da53883d02de3360e12violette fi
1cd2872b696c4bdfb7694da53883d02de3360e12violettefi
a5b9f8fb834b1b2208e59a2fa76714bd91a5f147violetteecho
1cd2872b696c4bdfb7694da53883d02de3360e12violette# End of the pre installation script