From: Jonatan Schlag Date: Tue, 30 May 2017 08:33:22 +0000 (+0200) Subject: route: cli parsing failed when a = was forgotten X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1901bd26f779af57dd3317b236bfc6da0db02a45;p=people%2Fjschlag%2Fnetwork.git route: cli parsing failed when a = was forgotten A command like network route add 192.168.101.0/24 --gateway 192.168.101.254 results in network to be set to 192.168.101.254 which is wrong. Signed-off-by: Jonatan Schlag --- diff --git a/src/functions/functions.route b/src/functions/functions.route index 4c4f7f6..640c871 100644 --- a/src/functions/functions.route +++ b/src/functions/functions.route @@ -50,7 +50,12 @@ route_add() { mtu=$(cli_get_val ${1}) ;; *) - network=${1} + if isset network; then + error "Bad number of arguments. Network passed twice or more" + return ${EXIT_ERROR} + else + network=${1} + fi ;; esac shift