Skip to content

Commit dfe2967

Browse files
Ivan Diazhnyman
authored andcommitted
watchcat: set default value for mmifacename to prevent argument shift
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 <diaz.it@icloud.com>
1 parent 5dc1390 commit dfe2967

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/watchcat/files/watchcat.init

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ config_watchcat() {
3838
config_get pingperiod "$1" pingperiod "60"
3939
config_get forcedelay "$1" forcedelay "60"
4040
config_get pingsize "$1" pingsize "standard"
41-
config_get interface "$1" interface # CHEK only if need a default?
42-
config_get mmifacename "$1" mmifacename # FIX HERE need a default?
41+
config_get interface "$1" interface
42+
config_get mmifacename "$1" mmifacename "null"
4343
config_get_bool unlockbands "$1" unlockbands "0"
4444
config_get addressfamily "$1" addressfamily "any"
4545
config_get script "$1" script
@@ -73,7 +73,7 @@ config_watchcat() {
7373
append_string "warn" "pingperiod cannot be a negative value." "; "
7474
fi
7575

76-
if [ "$mmifacename" != "" ] && [ "$period" -lt 30 ]; then
76+
if [ "$mmifacename" != "null" ] && [ "$period" -lt 30 ]; then
7777
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."
7878
fi
7979
fi

0 commit comments

Comments
 (0)