We now check the config inside the hook_parse_cmdline function. This mae it possible ti use this function in a generic edit function.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/hooks/configs/dhcp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/hooks/configs/dhcp b/src/hooks/configs/dhcp index 8bb6aa9..7f6780b 100644 --- a/src/hooks/configs/dhcp +++ b/src/hooks/configs/dhcp @@ -55,6 +55,12 @@ hook_parse_cmdline() { esac shift done + + # Check if the user disabled ipv6 and ipv4 + if ! enabled ENABLE_IPV6 && ! enabled ENABLE_IPV4; then + log ERROR "You disabled IPv6 and IPv4. At least one must be enabled" + return ${EXIT_ERROR} + fi }
hook_new() { @@ -71,13 +77,6 @@ hook_new() { return ${EXIT_ERROR} fi
- # Check if the user disabled ipv4 and ipv6 - - if ! enabled ENABLE_IPV6 && ! enabled ENABLE_IPV4; then - log ERROR "You disabled IPv6 and IPv4. At least one must be enabled" - return ${EXIT_ERROR} - fi - zone_config_settings_write "${zone}" "${HOOK}"
exit ${EXIT_OK}