From adc3a5850e561adad4b7f5defebd492ffe14fa91 Mon Sep 17 00:00:00 2001 From: "Johan .V" Date: Fri, 12 Jul 2024 14:21:44 +0200 Subject: [PATCH] Feat: Debug if modem is out --- data/patchs/root/usr/bin/jeedomLTE | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/patchs/root/usr/bin/jeedomLTE b/data/patchs/root/usr/bin/jeedomLTE index 80d0cef..a3198f5 100644 --- a/data/patchs/root/usr/bin/jeedomLTE +++ b/data/patchs/root/usr/bin/jeedomLTE @@ -26,7 +26,7 @@ if [ ! -f "$LOGFILE" ]; then touch "$LOGFILE" fi chown www-data:www-data $LOGFILE -DEBUG=true +DEBUG=false #Todo: Add debug option with systemctl start jeedomLTE.service option # while [[ "$#" -gt 0 ]]; do @@ -116,7 +116,6 @@ case "$1" in result=$? debug_log "Connection result: $result" if [ $result -eq 1 ]; then - DEBUG=FALSE debug_log "Modem is already connected." if [ ! -f /boot/jeedomLTE ]; then echo "1" | tee /boot/jeedomLTE > /dev/null @@ -125,9 +124,11 @@ case "$1" in if [ "$content" != "1" ]; then echo "1" | tee /boot/jeedomLTE > /dev/null fi + DEBUG=false sleep 20 continue else + DEBUG=true max_attempts=5 for attempt in $(seq 1 $max_attempts); do debug_log "Reconnection attempt $attempt of $max_attempts."