]> git.ipfire.org Git - network.git/commitdiff
CLI: Fix destroying zones
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 Sep 2018 11:45:49 +0000 (13:45 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 Sep 2018 11:50:54 +0000 (13:50 +0200)
The old delayed removal process doesn't exist any more

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

index cee7a7e1c1419da501a09e192c83ec47d11bbdd4..ae4016d68fc23030906d96c191631fbc25507f9b 100644 (file)
@@ -637,17 +637,15 @@ cli_zone_destroy() {
        fi
 
        local zone="${1}"
-       assert zone_exists "${zone}"
 
-       if zone_is_up ${zone}; then
-               echo "Zone '${zone}' is up and will be removed when it goes down the next time."
-               zone_destroy "${zone}"
-       else
-               echo "Removing zone '${zone}' now..."
-               zone_destroy_now "${zone}"
+       # Check if the zone exists
+       if ! zone_exists "${zone}"; then
+               error "Zone '${zone}' does not exist"
+               return ${EXIT_ERROR}
        fi
 
-       exit ${EXIT_OK}
+       echo "Removing zone '${zone}'..."
+       zone_destroy "${zone}" || exit $?
 }
 
 cli_zone_port() {