From: Michael Tremer Date: Mon, 17 Sep 2018 11:45:49 +0000 (+0200) Subject: CLI: Fix destroying zones X-Git-Tag: 010~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=165d0d94749cb63c2368990332f097ed48cead2e;p=network.git CLI: Fix destroying zones The old delayed removal process doesn't exist any more Signed-off-by: Michael Tremer --- diff --git a/src/network b/src/network index cee7a7e1..ae4016d6 100644 --- a/src/network +++ b/src/network @@ -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() {