Neels Hofmeyr | 1804aa8 | 2017-03-29 16:45:51 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ### BEGIN INIT INFO |
| 3 | # Provides: osmo-bsc_mgcp |
| 4 | # Required-Start: $syslog $networking |
| 5 | # Required-Stop: $syslog |
| 6 | # Default-Start: 5 |
| 7 | # Default-Stop: 1 |
| 8 | # Short-Description: Osmocom MGCP proxy |
| 9 | ### END INIT INFO |
| 10 | |
| 11 | DAEMON=/usr/bin/osmo-bsc_mgcp |
| 12 | NAME=osmo-bsc_mgcp |
| 13 | DESC="Osmocom MGCP proxy" |
| 14 | NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-mgcp.cfg" |
| 15 | |
| 16 | OSMOBSCMGCP_EXTRA_ARGS="" |
| 17 | NO_START=1 |
| 18 | |
| 19 | set -e |
| 20 | |
| 21 | test ! -r /etc/default/osmo-bsc_mgcp || . /etc/default/osmo-bsc_mgcp |
| 22 | test "$NO_START" = "0" || exit 0 |
| 23 | test -x "$DAEMON" || exit 0 |
| 24 | |
| 25 | case "$1" in |
| 26 | start) |
| 27 | echo -n "Starting $DESC: " |
| 28 | start-stop-daemon -S \ |
| 29 | -x "$DAEMON" -- $NORMAL_ARGS $OSMOBSCMGCP_EXTRA_ARGS |
| 30 | echo "$NAME." |
| 31 | ;; |
| 32 | stop) |
| 33 | echo -n "Stopping $DESC: " |
| 34 | start-stop-daemon -K -x "$DAEMON" |
| 35 | echo "$NAME." |
| 36 | ;; |
| 37 | restart) |
| 38 | $0 stop |
| 39 | $0 start |
| 40 | ;; |
| 41 | *) |
| 42 | N=/etc/init.d/$NAME |
| 43 | echo "Usage: $N {start|stop|restart}" >&2 |
| 44 | exit 1 |
| 45 | ;; |
| 46 | esac |
| 47 | |
| 48 | exit 0 |