projects
/
openhab-process.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Избегаем "залипания" последнего сообщения в MQTT.
[openhab-process.git]
/
mqtt-mpd
/
mqmpd
diff --git
a/mqtt-mpd/mqmpd
b/mqtt-mpd/mqmpd
index 5d378ea140a912862b797c4d3620e3a0ca2db6d8..595c08d9ca9b5f7dfd2b78a4377394a227651f81 100755
(executable)
--- a/
mqtt-mpd/mqmpd
+++ b/
mqtt-mpd/mqmpd
@@
-1,5
+1,7
@@
#!/bin/bash
#!/bin/bash
+id=`hostname`-$$
+
if [ "$1" = "stop" ]
then
if [ "$1" = "stop" ]
then
@@
-28,7
+30,7
@@
done
# сами остаемся слушать команды
# сами остаемся слушать команды
-mosquitto_sub -v -h $mqhost -p $mqport -t "$mqcmd/#" -u $mquser -P $mqpassword | while read line
+mosquitto_sub -
i mqtt-mpd-$id -
v -h $mqhost -p $mqport -t "$mqcmd/#" -u $mquser -P $mqpassword | while read line
do
template="s!$mqcmd/!!"
do
template="s!$mqcmd/!!"
@@
-113,7
+115,6
@@
do
esac
;;
currentnum)
esac
;;
currentnum)
- $mpccmd pause
$mpccmd play $arg
;;
repeat|random|single|consume)
$mpccmd play $arg
;;
repeat|random|single|consume)