]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/hooks/configs/ipv6-auto
hooks: Add HOOK_UNIQUE which stops us from creating multiple instances
[people/ms/network.git] / src / hooks / configs / ipv6-auto
index b2c398f127c9e5c543d97ce5d9511617bb0e9ec7..ecfafcd69b2c7c118003e0f798111616123e0358 100644 (file)
 
 . /usr/lib/network/header-config
 
-HOOK_CONFIG_SETTINGS="HOOK PRIVACY_EXTENSIONS"
+HOOK_SETTINGS=(
+       "PRIVACY_EXTENSIONS"
+)
 
 # Privacy Extensions are disabled by default
-PRIVACY_EXTENSIONS="off"
+DEFAULT_PRIVACY_EXTENSIONS="off"
 
 hook_check_config_settings() {
        assert isbool PRIVACY_EXTENSIONS
 }
 
-hook_create() {
-       local zone="${1}"
+hook_parse_cmdline() {
+       local id="${1}"
        shift
 
+       local arg
        while read arg; do
                case "${arg}" in
                        --privacy-extensions=*)
-                               local val="$(cli_get_val "${arg}")"
-
-                               if enabled val; then
-                                       PRIVACY_EXTENSIONS="on"
-                               else
-                                       PRIVACY_EXTENSIONS="off"
-                               fi
+                               PRIVACY_EXTENSIONS="$(cli_get_bool "${arg}")"
                                ;;
                esac
-       done <<< "$(args $@)"
-
-       zone_config_settings_write "${zone}" "${HOOK}"
-
-       exit ${EXIT_OK}
+       done <<< "$(args "$@")"
 }
 
 hook_up() {