]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.zone
Cleanup code that deletes ports/zones
[people/ms/network.git] / src / functions / functions.zone
index 9a47f67ab1f1d947524e0ef1d6586e65bc1158ad..b9d475f71745e7cbadd97bbff92bef3eb19a4228 100644 (file)
@@ -322,15 +322,19 @@ zone_destroy() {
                return ${EXIT_ERROR}
        fi
 
-       log INFO "Destroying zone ${zone}"
-
        # Force the zone down.
        zone_is_active "${zone}" && zone_stop "${zone}"
 
        # Disable zone auto-start
        zone_disable "${zone}"
 
-       rm -rf "${NETWORK_ZONES_DIR}/${zone}"
+       if ! rm -rf "${NETWORK_ZONES_DIR}/${zone}"; then
+               log ERROR "Could not destroy zone ${zone}"
+               return ${EXIT_ERROR}
+       fi
+
+       log INFO "Destroyed zone ${zone}"
+       return ${EXIT_OK}
 }
 
 zone_up() {
@@ -696,22 +700,6 @@ zone_config_convert_hid_to_id() {
        return ${EXIT_FALSE}
 }
 
-zone_show() {
-       local zone=${1}
-
-       echo "${zone}"
-       echo "  Type: $(zone_get_hook ${zone})"
-       echo
-}
-
-zones_show() {
-       local zone
-
-       for zone in $(zones_get "$@"); do
-               zone_show ${zone}
-       done
-}
-
 zones_get_all() {
        local zone
        for zone in $(list_directory "${NETWORK_ZONES_DIR}"); do