Browse Source

postinst: run init_wrapper() on ce systems as well

From: Michael Prokop <mprokop@sipwise.com>
git.mgm/mediaproxy-ng/2.0
Michael Prokop 15 years ago
parent
commit
e19de5607e
1 changed files with 11 additions and 9 deletions
  1. +11
    -9
      debian/ngcp-mediaproxy-ng-daemon.postinst

+ 11
- 9
debian/ngcp-mediaproxy-ng-daemon.postinst View File

@ -3,6 +3,7 @@
set -e set -e
# DEBHELPER like wrapper
init_wrapper() { init_wrapper() {
if [ -x "/etc/init.d/ngcp-mediaproxy-ng-daemon" ]; then if [ -x "/etc/init.d/ngcp-mediaproxy-ng-daemon" ]; then
if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then
@ -14,17 +15,18 @@ init_wrapper() {
} }
restart_daemon() { restart_daemon() {
# ce systems do not provide ngcp-check_active
# just invoke init script wrapper 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 if ! [ -x "$(which ngcp-check_active 2>/dev/null)" ]; then
return 0
fi
# do not restart daemon on inactive node in pro systems
if ngcp-check_active ; then
echo "Active node detected, restarting ngcp-mediaproxy-ng-daemon"
init_wrapper init_wrapper
else
echo "Inactive node detected, ignoring request to restart ngcp-mediaproxy-ng-daemon"
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"
init_wrapper
else
echo "Inactive node detected, ignoring request to restart ngcp-mediaproxy-ng-daemon"
fi
fi fi
} }


Loading…
Cancel
Save