You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mediaproxy-ng/debian/ngcp-mediaproxy-ng-daemon.p...

34 lines
656 B

#!/bin/sh
# prerm script for ngcp-mediaproxy-ng-daemon
set -e
stop_handler() {
if [ -x "/etc/init.d/ngcp-mediaproxy-ng-daemon" ]; then
invoke-rc.d ngcp-mediaproxy-ng-daemon stop || exit $?
fi
}
stop_daemon() {
# just stop the service on ce systems because
# the pro system handle it as part of their monitoring/HA setup
if ! [ -x "$(which ngcp-check_active 2>/dev/null)" ]; then
stop_handler
else
case "$2" in
upgrade)
echo "Detected upgrade procedure, not stopping ngcp-mediaproxy-ng-daemon service."
;;
remove|purge)
stop_handler
;;
esac
fi
}
if [ "$1" = "prerm" ] ; then
stop_daemon
fi
exit 0