commit | author | age
|
9f94a1
|
1 |
#! /bin/sh |
MF |
2 |
# |
|
3 |
# metronome Start/stop metronome server |
|
4 |
# |
|
5 |
|
|
6 |
### BEGIN INIT INFO |
|
7 |
# Provides: metronome |
|
8 |
# Required-Start: $remote_fs $network $named $time |
|
9 |
# Required-Stop: $remote_fs $network $named $time |
|
10 |
# Default-Start: 2 3 4 5 |
|
11 |
# Default-Stop: 0 1 6 |
|
12 |
# Short-Description: Starts metronome server |
|
13 |
# Description: Starts metronome server, an XMPP server written in Lua. |
|
14 |
### END INIT INFO |
|
15 |
|
|
16 |
METRONOME=/usr/bin/metronomectl |
|
17 |
PIDDIR=/var/run/metronome |
|
18 |
NAME=metronome |
|
19 |
|
|
20 |
test -e $METRONOME || exit 0 |
|
21 |
|
|
22 |
start() |
|
23 |
{ |
|
24 |
mkdir $PIDDIR -p |
|
25 |
chown metronome:metronome $PIDDIR |
|
26 |
chmod 750 $PIDDIR |
|
27 |
|
|
28 |
$METRONOME start >> /dev/null |
|
29 |
} |
|
30 |
|
|
31 |
stop() |
|
32 |
{ |
|
33 |
$METRONOME stop >> /dev/null |
|
34 |
} |
|
35 |
|
f52de0
|
36 |
reload() |
MF |
37 |
{ |
d5fb30
|
38 |
$METRONOME reload >> /dev/null |
f52de0
|
39 |
} |
MF |
40 |
|
|
41 |
restart() |
|
42 |
{ |
d5fb30
|
43 |
$METRONOME restart >> /dev/null |
f52de0
|
44 |
} |
MF |
45 |
|
9f94a1
|
46 |
case "$1" in |
MF |
47 |
start) |
|
48 |
echo -n "Starting Metronome..." |
|
49 |
start & |
|
50 |
;; |
|
51 |
stop) |
|
52 |
echo -n "Stopping Metronome..." |
|
53 |
stop & |
|
54 |
;; |
f52de0
|
55 |
reload) |
MF |
56 |
echo -n "Reloading Metronome config..." |
|
57 |
reload & |
|
58 |
;; |
9f94a1
|
59 |
restart) |
MF |
60 |
echo -n "Restarting Metronome..." |
f52de0
|
61 |
restart & |
9f94a1
|
62 |
;; |
MF |
63 |
*) |
f52de0
|
64 |
echo "Usage: $0 {start|stop|reload|restart}" >&2 |
9f94a1
|
65 |
exit 1 |
MF |
66 |
;; |
|
67 |
esac |
|
68 |
|
|
69 |
if [ $? -eq 0 ]; then |
|
70 |
echo . |
|
71 |
else |
|
72 |
echo " failed!" |
|
73 |
fi |
|
74 |
|
|
75 |
exit 0 |