-
Notifications
You must be signed in to change notification settings - Fork 0
/
mqttvolD
62 lines (54 loc) · 846 Bytes
/
mqttvolD
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
53
54
55
56
57
58
59
60
61
62
#! /bin/sh
### BEGIN INIT INFO
# Provides: Volume Control
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: AlsaVolume2MQTT
# Description: This sends MQTT messages on detect
### END INIT INFO
# Author: Doug
#
#!/bin/sh
RETVAL=0
prog="pyvol /var/www/html/MqttVol.py"
start() {
echo -n $"Starting MqttVol:"
echo $prog
$prog &
}
stop() {
echo -n $"stopping MqttVol:"
echo ""
pkill pyvol
}
reload() {
echo -n $"Reloading MqttVol:"
echo ""
pkill pyvol
$prog &
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
status)
status MqttVol
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
RETVAL=1
esac
exit $RETVAL