blob: 058ec80c0269306682a2f3f147d13cfc22b0bb0a [file] [log] [blame]
Neels Hofmeyr1804aa82017-03-29 16:45:51 +02001#!/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
11DAEMON=/usr/bin/osmo-bsc_mgcp
12NAME=osmo-bsc_mgcp
13DESC="Osmocom MGCP proxy"
14NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-mgcp.cfg"
15
16OSMOBSCMGCP_EXTRA_ARGS=""
17NO_START=1
18
19set -e
20
21test ! -r /etc/default/osmo-bsc_mgcp || . /etc/default/osmo-bsc_mgcp
22test "$NO_START" = "0" || exit 0
23test -x "$DAEMON" || exit 0
24
25case "$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 ;;
46esac
47
48exit 0