generic-poky/meta-telephony/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init

49 lines
901 B
Bash
Executable File

#!/bin/sh
### BEGIN INIT INFO
# Provides: osmo-sgsn
# Required-Start: $syslog $networking
# Required-Stop: $syslog
# Default-Start: 5
# Default-Stop: 1
# Short-Description: Osmocom Serving GPRS Support Node
### END INIT INFO
DAEMON=/usr/bin/osmo-sgsn
NAME=osmo-sgsn
DESC="Osmocom Serving GPRS Support Node"
NORMAL_ARGS="-D -c /etc/osmocom/osmo-sgsn.cfg"
OSMOSGSN_EXTRA_ARGS=""
NO_START=0
set -e
test ! -r /etc/default/osmo-sgsn || . /etc/default/osmo-sgsn
test "$NO_START" = "0" || exit 0
test -x "$DAEMON" || exit 0
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon -S \
-x "$DAEMON" -- $NORMAL_ARGS $OSMOSGSN_EXTRA_ARGS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon -K -x "$DAEMON"
echo "$NAME."
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart}" >&2
exit 1
;;
esac
exit 0