]> git.ipfire.org Git - people/ms/network.git/commitdiff
network check if a zone exist before executing commands
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 21 Jun 2017 07:45:28 +0000 (09:45 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Jun 2017 14:47:18 +0000 (16:47 +0200)
We checked if a zone name was valid so
network zone net0 ... fails when theres was no zone net0.
net0 is a valid zone name so we jumped into the wrong if part.
We now check if a zone exist and when now
network zone net0 ...  is called when no zone net0 exists
we print an error message.
This behaviour is similar to network port .., there we do the same thing with port_exists

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/network

index e2c9db303aebc590a7f9c7de6e2d93d2cdb7acc7..154d25361e2e1f68725c4c04f645b6f11e29f7fa 100644 (file)
@@ -554,7 +554,7 @@ cli_zone() {
        local action
        local zone
 
-       if zone_name_is_valid ${1}; then
+       if zone_exists ${1}; then
                zone=${1}
                action=${2}
                shift 2