'Bash/Pinger/Dual-IF-Ping.sh.example' updaten

This commit is contained in:
2020-06-05 01:28:55 +00:00
parent 81ca2a1d24
commit bb5bbe2693

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#Trigger form Cron
#Trigger form Cron */5 * * * * root bash <fileLocation> > /dev/null 2>&1
# Set Parameters
domoticzserverip='127.0.0.1:8080'
if1='<IP of first if>'
@@ -88,7 +88,7 @@ domoticzstatus2=$(curl -s "http://"$domoticzserverip"/json.htm?type=devices&rid=
# Compare ping result to Domoticz device status
if [ "$device2" != "$domoticzstatus2" ] ; then
if [ "$device1" = On ] ; then
if [ "$device2" = On ] ; then
curl -s "http://"$domoticzserverip"/json.htm?type=command&param=switchlight&idx="$IDX2"&switchcmd=On" 2>/dev/null 1>/dev/null
else
curl -s "http://"$domoticzserverip"/json.htm?type=command&param=switchlight&idx="$IDX2"&switchcmd=Off" 2>/dev/null 1>/dev/null