'Bash/Pinger/BTPing.sh.examp' updaten
This commit is contained in:
@@ -41,11 +41,12 @@ fi
|
|||||||
|
|
||||||
# Check Online / Offline state of Domoticz device
|
# Check Online / Offline state of Domoticz device
|
||||||
domoticzstatus=$(curl -s "http://"$domoticzserverip"/json.htm?type=devices&rid="$IDX"" | grep '"Data" :' | awk '{ print $3 }' | sed 's/[!@#\$%",^&*()]//g')
|
domoticzstatus=$(curl -s "http://"$domoticzserverip"/json.htm?type=devices&rid="$IDX"" | grep '"Data" :' | awk '{ print $3 }' | sed 's/[!@#\$%",^&*()]//g')
|
||||||
|
CurTime=$(date '+%d/%m/%Y %H:%M');
|
||||||
# Compare ping result to Domoticz device status
|
# Compare ping result to Domoticz device status
|
||||||
if [ "$device" = "$domoticzstatus" ] ; then
|
if [ "$device" = "$domoticzstatus" ] ; then
|
||||||
echo "Current status: $technology"
|
echo "$CurTime | Device: $Name | Status: $technology"
|
||||||
else
|
else
|
||||||
echo "Status desynchronized, resynchronizing..."
|
#echo "Status desynchronized, resynchronizing..."
|
||||||
if [ "$device" = On ] ; then
|
if [ "$device" = On ] ; then
|
||||||
echo "$CurTime | Device: $Name | Sync: Online"
|
echo "$CurTime | Device: $Name | Sync: Online"
|
||||||
curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX"&switchcmd=On" 2>/dev/null 1>/dev/null
|
curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX"&switchcmd=On" 2>/dev/null 1>/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user