From 8c3bfed83f313243bab0bbb7d6c014d5d4b59323 Mon Sep 17 00:00:00 2001 From: Ratatoskr Date: Wed, 27 Dec 2023 12:47:55 +0100 Subject: [PATCH] Fix syntax error in check_ip function and handle unsuccessful attempts. Update wecker.sh: Fix syntax error in 'for' loop --- wecker.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wecker.sh b/wecker.sh index 6656be9..0cbcb1b 100755 --- a/wecker.sh +++ b/wecker.sh @@ -46,7 +46,7 @@ check_ip() { attempts=10 interval=5 - or ((i = 1; i <= $attempts; i++)); do + for ((i = 1; i <= $attempts; i++)); do A72_ip=$(arp-scan -r 5 -v --localnet | grep "$mac_address" | awk '{print $1}') if [ -n "$A72_ip" ]; then @@ -75,7 +75,9 @@ check_ip() { # Alle Versuche erfolglos echo "Das Ziel konnte nach $attempts Versuchen nicht erreicht werden." + iobroker state set zigbee.0.04cd15fffee03198.state false return 1 # Fehler: Das Ziel konnte nicht erreicht werden + exit } # check_ip -Funktion ausführen.