|
|
|
|
@ -5,9 +5,11 @@ set -e
|
|
|
|
|
dpkg-maintscript-helper rm_conffile /etc/default/sems -- "$@"
|
|
|
|
|
dpkg-maintscript-helper rm_conffile /etc/init.d/sems -- "$@"
|
|
|
|
|
|
|
|
|
|
# don't do anything when called with other argument than configure
|
|
|
|
|
case "$1" in
|
|
|
|
|
configure)
|
|
|
|
|
# add sems user
|
|
|
|
|
adduser --quiet --system --group --disabled-password --shell /bin/false \
|
|
|
|
|
--gecos "SIP Express Media Server" --home /var/run/ngcp-sems sems || true
|
|
|
|
|
;;
|
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
|
|
|
exit 0
|
|
|
|
|
@ -18,54 +20,6 @@ case "$1" in
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
restart_handler() {
|
|
|
|
|
if [ -x "/etc/init.d/ngcp-sems" ]; then
|
|
|
|
|
if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then
|
|
|
|
|
invoke-rc.d ngcp-sems restart || exit $?
|
|
|
|
|
else
|
|
|
|
|
/etc/init.d/ngcp-sems restart || exit $?
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initscript_handler() {
|
|
|
|
|
if [ -x "/etc/init.d/ngcp-sems" ]; then
|
|
|
|
|
update-rc.d ngcp-sems defaults >/dev/null
|
|
|
|
|
invoke-rc.d ngcp-sems 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-sems"
|
|
|
|
|
restart_handler
|
|
|
|
|
else
|
|
|
|
|
echo "Inactive node detected, ignoring request to restart ngcp-sems"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# add sems user
|
|
|
|
|
adduser --quiet --system --group --disabled-password --shell /bin/false \
|
|
|
|
|
--gecos "SIP Express Media Server" --home /var/run/ngcp-sems sems || true
|
|
|
|
|
|
|
|
|
|
init_handler
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "***"
|
|
|
|
|
echo "Configuration of ngcp-sems has finished."
|
|
|
|
|
echo ""
|
|
|
|
|
echo "To restart it when configuration has changed use '/etc/init.d/ngcp-sems restart'"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "To change it's configuration use 'dpkg-reconfigure ngcp-sems'"
|
|
|
|
|
echo "***"
|
|
|
|
|
echo ""
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|