]> git.ipfire.org Git - network.git/commitdiff
ipv4-dhcp: prevent multiple configs for the same zone
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 4 Jul 2017 15:46:08 +0000 (17:46 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Jul 2017 21:16:54 +0000 (23:16 +0200)
It is senseless to configure the ipv4-dhcp hook
multiple times for a zone.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hooks/configs/ipv4-dhcp

index ef230821f1f08317736249fe2a0dbfaf53d8ab5b..39e03127920771ba9e582b884d0b24b8df2ca076 100644 (file)
@@ -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=*)