From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: network@lists.ipfire.org Subject: [PATCH 4/7] ipv4-dhcp: prevent multiple configs for the same zone Date: Tue, 04 Jul 2017 17:46:08 +0200 Message-ID: <1499183171-24236-4-git-send-email-jonatan.schlag@ipfire.org> In-Reply-To: <1499183171-24236-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5401821886107015116==" List-Id: --===============5401821886107015116== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit It is senseless to configure the ipv4-dhcp hook multiple times for a zone. Signed-off-by: Jonatan Schlag --- src/hooks/configs/ipv4-dhcp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/configs/ipv4-dhcp b/src/hooks/configs/ipv4-dhcp index ef23082..39e0312 100644 --- a/src/hooks/configs/ipv4-dhcp +++ b/src/hooks/configs/ipv4-dhcp @@ -35,6 +35,11 @@ hook_new() { local zone="${1}" shift + if zone_config_hook_is_configured ${zone} "ipv4-dhcp"; then + log ERROR "You can configure the ipv4-dhcp hook only once for a zone" + return ${EXIT_ERROR} + fi + while [ $# -gt 0 ]; do case "${1}" in --delay=*) -- 2.6.3 --===============5401821886107015116==--