]> git.ipfire.org Git - people/ms/network.git/commitdiff
route: cli parsing failed when a = was forgotten
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 30 May 2017 08:33:22 +0000 (10:33 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 30 May 2017 08:33:22 +0000 (10:33 +0200)
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 <jonatan.schlag@ipfire.org>
src/functions/functions.route

index 4c4f7f6347de204c4795761be31d10ccff9a7dde..640c8713aafbc457a0c22679ca9b29f229f7f242 100644 (file)
@@ -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