Restored second cronjob

This commit is contained in:
Dennis Eisold 2022-03-07 17:46:04 +01:00
parent b75041997b
commit 4721f2086e
3 changed files with 4 additions and 5 deletions

View File

@ -0,0 +1 @@
*/5 * * * * sleep $(/usr/bin/random 70 85); /usr/sbin/json-mqtt-proxy

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
MACADDR=$(cat /sys/class/net/br-client/address | /bin/sed 's/://g') MACADDR=$(/bin/sed 's/://g' < /sys/class/net/br-client/address)
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
if [ -n "$(uci -q get fff.mqtt.server)" ] ; then if [ -n "$(uci -q get fff.mqtt.server)" ] ; then
mosquitto_pub -h "$(uci get fff.mqtt.server)" -p 1883 -t /monitoring/v2/$MACADDR -f $SCRIPT_DATA_FILE mosquitto_pub -h "$(uci get fff.mqtt.server)" -p 1883 -t /monitoring/v2/"$MACADDR" -f "$SCRIPT_DATA_FILE"
fi fi

View File

@ -42,6 +42,4 @@ LANG=C
debug "Generate actual status data" debug "Generate actual status data"
crawl crawl
/usr/sbin/json-mqtt-proxy exit 0
exit 0