watchcat: set default value for mmifacename to prevent argument shift
authorIvan Diaz <redacted>
Fri, 21 Nov 2025 22:13:40 +0000 (17:13 -0500)
committerHannu Nyman <redacted>
Tue, 9 Dec 2025 11:12:19 +0000 (12:12 +0100)
Set mmifacename default to "null" instead of an empty string to avoid
argument displacement when the value is not defined. Also remove leftover
debug comments from previous commit.

Signed-off-by: Ivan Diaz <redacted>
utils/watchcat/files/watchcat.init

index a21712e1f545f5006b9187cd9b748686a635d7cf..dcaa8ece5b0d25c9a976ecc5de61b357e69de84b 100644 (file)
@@ -38,8 +38,8 @@ config_watchcat() {
        config_get pingperiod "$1" pingperiod "60"
        config_get forcedelay "$1" forcedelay "60"
        config_get pingsize "$1" pingsize "standard"
-       config_get interface "$1" interface # CHEK only if need a default?
-       config_get mmifacename "$1" mmifacename # FIX HERE need a default?
+       config_get interface "$1" interface
+       config_get mmifacename "$1" mmifacename "null"
        config_get_bool unlockbands "$1" unlockbands "0"
        config_get addressfamily "$1" addressfamily "any"
        config_get script "$1" script
@@ -73,7 +73,7 @@ config_watchcat() {
                                append_string "warn" "pingperiod cannot be a negative value." "; "
                        fi
 
-                       if [ "$mmifacename" != "" ] && [ "$period" -lt 30 ]; then
+                       if [ "$mmifacename" != "null" ] && [ "$period" -lt 30 ]; then
                                append_string "error" "Check interval is less than 30s. For robust operation with ModemManager modem interfaces it is recommended to set the period to at least 30s."
                        fi
                fi
git clone https://git.99rst.org/PROJECT