forked from splitbrain/Watcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
watcher.init.d
executable file
·52 lines (42 loc) · 981 Bytes
/
watcher.init.d
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
49
50
51
52
#!/bin/bash
### BEGIN INIT INFO
# Provides: watcher
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop Watcher that watches specified files/folders for changes
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Watches specified files/folders for changes"
NAME="watcher"
DAEMON="/usr/bin/watcher.py"
DAEMON_CONFIG="/etc/watcher.ini"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
start() {
$DAEMON start -c $DAEMON_CONFIG
}
stop() {
$DAEMON stop -c $DAEMON_CONFIG
}
restart() {
$DAEMON restart -c $DAEMON_CONFIG
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
status)
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac