From: JINMEI Tatuya Date: Wed, 5 Jan 2022 22:04:32 +0000 (-0800) Subject: avoid referencing netconf related param without building it X-Git-Tag: Kea-2.1.3~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6967edeaae98ec062cc3057e8f7d63d5d3fdac72;p=thirdparty%2Fkea.git avoid referencing netconf related param without building it --- diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in index d73999af3c..32a5c65fc6 100644 --- a/src/bin/keactrl/keactrl.in +++ b/src/bin/keactrl/keactrl.in @@ -294,11 +294,8 @@ run_conditional() { else is_all=1 fi - # Return for for netconf when not available. + if [ "${server}" = "netconf" ]; then - if ! ${have_netconf}; then - return - fi # reload is not supported for netconf. if [ "${command}" = "reload" ]; then if [ "${is_all}" -eq 1 ]; then @@ -452,7 +449,9 @@ dhcp4=$( printf "%s" "${dhcp4}" | tr '[:upper:]' '[:lower:]' ) dhcp6=$( printf "%s" "${dhcp6}" | tr '[:upper:]' '[:lower:]' ) dhcp_ddns=$( printf "%s" "${dhcp_ddns}" | tr '[:upper:]' '[:lower:]' ) ctrl_agent=$( printf "%s" "${ctrl_agent}" | tr '[:upper:]' '[:lower:]' ) -netconf=$( printf "%s" "${netconf}" | tr '[:upper:]' '[:lower:]' ) +if ${have_netconf}; then + netconf=$( printf "%s" "${netconf}" | tr '[:upper:]' '[:lower:]' ) +fi case ${command} in # Start the servers. @@ -473,8 +472,10 @@ case ${command} in ${args}" 1 run_conditional "ctrl_agent" "start_server ${ctrl_agent_srv} -c ${kea_ctrl_agent_config_file} \ ${args}" 1 - run_conditional "netconf" "start_server ${netconf_srv} -c ${kea_netconf_config_file} \ + if ${have_netconf}; then + run_conditional "netconf" "start_server ${netconf_srv} -c ${kea_netconf_config_file} \ ${args}" 1 + fi exit 0 ;; @@ -485,7 +486,9 @@ ${args}" 1 run_conditional "dhcp6" "stop_server ${dhcp6_srv}" 0 run_conditional "dhcp_ddns" "stop_server ${dhcp_ddns_srv}" 0 run_conditional "ctrl_agent" "stop_server ${ctrl_agent_srv}" 0 - run_conditional "netconf" "stop_server ${netconf_srv}" 0 + if ${have_netconf}; then + run_conditional "netconf" "stop_server ${netconf_srv}" 0 + fi exit 0 ;; @@ -496,7 +499,9 @@ ${args}" 1 run_conditional "dhcp6" "reload_server ${dhcp6_srv}" 0 run_conditional "dhcp_ddns" "reload_server ${dhcp_ddns_srv}" 0 run_conditional "ctrl_agent" "reload_server ${ctrl_agent_srv}" 0 - run_conditional "netconf" "reload_server ${netconf_srv}" 0 + if ${have_netconf}; then + run_conditional "netconf" "reload_server ${netconf_srv}" 0 + fi exit 0 ;; @@ -574,7 +579,9 @@ ${args}" 1 run_conditional "dhcp6" "print_version kea-dhcp6 ${dhcp6_srv}" 0 run_conditional "dhcp_ddns" "print_version kea-dhcp-ddns ${dhcp_ddns_srv}" 0 run_conditional "ctrl_agent" "print_version kea-ctrl-agent ${ctrl_agent_srv}" 0 - run_conditional "netconf" "print_version kea-netconf ${netconf_srv}" 0 + if ${have_netconf}; then + run_conditional "netconf" "print_version kea-netconf ${netconf_srv}" 0 + fi exit 0 ;;