Fixes: #11368
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/functions/functions.zone | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 91ce629..eccca3a 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -369,6 +369,12 @@ zone_up() { return ${EXIT_ERROR} fi
+ # Check if the zone is already up + if zone_is_active ${zone}; then + log ERROR "Zone ${zone} is already up" + return ${EXIT_ERROR} + fi + # Check if a zone has got the remove tag. if zone_has_destroy_tag ${zone}; then error "Cannot bring up any zone which is to be removed." @@ -405,6 +411,13 @@ zone_down() { return ${EXIT_ERROR} fi
+ # Check if the zone is already down + if ! zone_is_active ${zone}; then + log ERROR "Zone ${zone} is already down" + return ${EXIT_ERROR} + fi + + local hook="$(zone_get_hook "${zone}")" if [ -z "${hook}" ]; then error "Config file did not provide any hook."