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.
55 lines
1.3 KiB
55 lines
1.3 KiB
#!/bin/sh
|
|
# postinst script for ngcp-mediaproxy-ng-daemon
|
|
|
|
set -e
|
|
|
|
restart_handler() {
|
|
if [ -x "/etc/init.d/ngcp-mediaproxy-ng-daemon" ]; then
|
|
if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then
|
|
invoke-rc.d ngcp-mediaproxy-ng-daemon restart || exit $?
|
|
else
|
|
/etc/init.d/ngcp-mediaproxy-ng-daemon restart || exit $?
|
|
fi
|
|
fi
|
|
}
|
|
|
|
initscript_handler() {
|
|
if [ -x "/etc/init.d/ngcp-mediaproxy-ng-daemon" ]; then
|
|
update-rc.d ngcp-mediaproxy-ng-daemon defaults >/dev/null
|
|
invoke-rc.d ngcp-mediaproxy-ng-daemon start || exit $?
|
|
fi
|
|
}
|
|
|
|
init_handler() {
|
|
# just invoke init script wrappers on ce systems since
|
|
# they do not provide ngcp-check_active and we don't
|
|
# have to handle inactive nodes
|
|
if ! [ -x "$(which ngcp-check_active 2>/dev/null)" ]; then
|
|
restart_handler
|
|
initscript_handler
|
|
else # do not restart daemon on inactive node in pro systems
|
|
if ngcp-check_active ; then
|
|
echo "Active node detected, restarting ngcp-mediaproxy-ng-daemon"
|
|
restart_handler
|
|
else
|
|
echo "Inactive node detected, ignoring request to restart ngcp-mediaproxy-ng-daemon"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
configure)
|
|
init_handler
|
|
;;
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
;;
|
|
|
|
*)
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|