forked from ursereg/ntripclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathntripclient-init.sh
More file actions
49 lines (45 loc) · 1.24 KB
/
Copy pathntripclient-init.sh
File metadata and controls
49 lines (45 loc) · 1.24 KB
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: ntripclient
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage NTRIP client
### END INIT INFO
set -e
daemon="/usr/bin/ntripclient.sh"
process_kill="ntripclient"
pidfile="/var/run/ntripclient.pid"
daemon_opts=""
[ -x "${daemon}" ] || exit 0
case "${1}" in
start)
echo -n "Starting ntripclient: "
if [ -s "${pidfile}" ]; then
echo "already running, restarting"
start-stop-daemon -K -q -p "${pidfile}"
fi
start-stop-daemon -S -b -m -p "${pidfile}" -x "${daemon}" -- ${daemon_opts}
echo "done"
;;
stop)
echo -n "Stopping ntripclient: "
start-stop-daemon -K -q -p "${pidfile}"
killall "${process_kill}"
rm "${pidfile}"
echo "done"
;;
restart)
echo -n "Restarting ntripclient: "
start-stop-daemon -K -q -p "${pidfile}"
killall "${process_kill}"
rm "${pidfile}"
start-stop-daemon -S -b -m -p "${pidfile}" -x "${daemon}" -- ${daemon_opts}
echo "done"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac