#!/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