From 975121e31c7b1426039e4199c3e4f2d658cfc919 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 20 Feb 2020 10:32:12 +0000 Subject: [PATCH] 'Bash/Pinger/BTPing.sh.examp' updaten --- Bash/Pinger/BTPing.sh.examp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Bash/Pinger/BTPing.sh.examp b/Bash/Pinger/BTPing.sh.examp index c7f15f6..6efa1bf 100644 --- a/Bash/Pinger/BTPing.sh.examp +++ b/Bash/Pinger/BTPing.sh.examp @@ -14,7 +14,7 @@ do bt1=$(l2ping -c5 -s32 -t1000 "$bluetoothmac" > /dev/null 2>&1 && echo "On" || echo "Off") if [[ $bt1 == 'On' ]]; then device="On" -technology="Online using: Bluetooth 1" +technology="Online, Bluetooth 1" success="yes" fi @@ -28,7 +28,7 @@ if [[ $success != 'yes' ]]; then bt2=$(l2ping -c5 -s32 -t1000 "$bluetoothmac" > /dev/null 2>&1 && echo "On" || echo "Off") if [[ $bt2 == 'On' ]]; then device="On" -technology="Online using: Bluetooth 2" +technology="Online, Bluetooth 2" success="yes" fi fi @@ -47,10 +47,10 @@ echo "Current status: $technology" else echo "Status desynchronized, resynchronizing..." if [ "$device" = On ] ; then -echo "$Name" "set 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 else -echo "$Name" "set Offline" +echo "$CurTime | Device: $Name | Sync: Offline" curl -s "http://"$domoticzserverip"/json.htm?type=command¶m=switchlight&idx="$IDX"&switchcmd=Off" 2>/dev/null 1>/dev/null fi fi @@ -59,5 +59,10 @@ fi if [[ $success != 'yes' ]]; then sleep 10 fi + +#Waiting if Device is online +if [ "$device" = On ] ; then +echo "$CurTime | Device: $Name | Status: Online, Waiting" +sleep 60 done