]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
avoid referencing netconf related param without building it
authorJINMEI Tatuya <jtatuya@infoblox.com>
Wed, 5 Jan 2022 22:04:32 +0000 (14:04 -0800)
committerRazvan Becheriu <razvan@isc.org>
Thu, 10 Feb 2022 19:20:15 +0000 (21:20 +0200)
src/bin/keactrl/keactrl.in

index d73999af3cc4ecf011e1cf1095c2c4a3a02a5967..32a5c65fc69210c50e022dbdd8ba6ed402b79539 100644 (file)
@@ -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 ;;