From: Michael Tremer Date: Thu, 10 Aug 2017 21:16:20 +0000 (+0200) Subject: ports: Cannot delete a port that does not exist X-Git-Tag: 009~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab5edf530bc99b109630ba0170227aa9960f681c;p=network.git ports: Cannot delete a port that does not exist Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.ports b/src/functions/functions.ports index 3f873c99..fcb92066 100644 --- a/src/functions/functions.ports +++ b/src/functions/functions.ports @@ -170,10 +170,13 @@ port_new() { port_destroy() { local port=${1} - assert isset port - port_exists ${port} || return ${EXIT_OK} + # Cannot delete a port that does not exist + if ! port_exists ${port}; then + error "No such port: ${port}" + return ${EXIT_ERROR} + fi # Check if the port is attached to any zone and don't delete it. local ok=${EXIT_OK}