aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-osmocom/osmo-hlr/osmo-hlr/osmo-hlr.init
blob: 2444f8973f411a4dd256a83caf80d3581964a7ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
!/bin/sh
### BEGIN INIT INFO
# Provides:		osmo-hlr
# Required-Start:	$syslog $networking
# Required-Stop:	$syslog
# Default-Start:	5
# Default-Stop:		1
# Short-Description:	Osmocom HLR
### END INIT INFO

DAEMON=/usr/bin/osmo-hlr
NAME=osmo-hlr
DESC="Osmocom HLR"
NORMAL_ARGS="-D -c /etc/osmocom/osmo-hlr.cfg -l /var/lib/osmocom/hlr.db"

OSMOHLR_EXTRA_ARGS=""
NO_START=1

set -e

test ! -r /etc/default/osmo-hlr || . /etc/default/osmo-hlr
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 $OSMOHLR_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