2022-03-07 08:52:41 +01:00
|
|
|
#!/bin/sh
|
2022-03-07 17:46:04 +01:00
|
|
|
MACADDR=$(/bin/sed 's/://g' < /sys/class/net/br-client/address)
|
2022-03-07 10:07:59 +01:00
|
|
|
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
|
2022-03-07 08:52:41 +01:00
|
|
|
|
|
|
|
if [ -n "$(uci -q get fff.mqtt.server)" ] ; then
|
2022-03-07 17:46:04 +01:00
|
|
|
mosquitto_pub -h "$(uci get fff.mqtt.server)" -p 1883 -t /monitoring/v2/"$MACADDR" -f "$SCRIPT_DATA_FILE"
|
2022-03-07 08:52:41 +01:00
|
|
|
fi
|