'Bash/Pinger/Dual-IF-Ping.sh.example' updaten
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#Trigger form Cron
|
#Trigger form Cron */5 * * * * root bash <fileLocation> > /dev/null 2>&1
|
||||||
# Set Parameters
|
# Set Parameters
|
||||||
domoticzserverip='127.0.0.1:8080'
|
domoticzserverip='127.0.0.1:8080'
|
||||||
if1='<IP of first if>'
|
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
|
# Compare ping result to Domoticz device status
|
||||||
if [ "$device2" != "$domoticzstatus2" ] ; then
|
if [ "$device2" != "$domoticzstatus2" ] ; then
|
||||||
if [ "$device1" = On ] ; then
|
if [ "$device2" = On ] ; then
|
||||||
curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX2"&switchcmd=On" 2>/dev/null 1>/dev/null
|
curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX2"&switchcmd=On" 2>/dev/null 1>/dev/null
|
||||||
else
|
else
|
||||||
curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX2"&switchcmd=Off" 2>/dev/null 1>/dev/null
|
curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX2"&switchcmd=Off" 2>/dev/null 1>/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user