From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: network@lists.ipfire.org Subject: [PATCH 8/8] zone: Check early if a id is valid Date: Wed, 05 Jul 2017 16:19:53 +0200 Message-ID: <1499264393-13700-8-git-send-email-jonatan.schlag@ipfire.org> In-Reply-To: <1499264393-13700-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5179402963006949791==" List-Id: --===============5179402963006949791== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Signed-off-by: Jonatan Schlag --- src/functions/functions.zone | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 776b63b..d121225 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -550,7 +550,12 @@ zone_config() { zone_config_new "${zone}" "$@" ;; destroy) - zone_config_destroy "${zone}" "$@" + local id=${1} + if zone_config_id_is_valid ${zone} ${id}; then + zone_config_destroy "${zone}" "$@" + else + log ERROR "${id} is not a valid id" + fi ;; edit) zone_config_edit "${zone}" "$@" -- 2.6.3 --===============5179402963006949791==--