]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2262] fixed keactrl when netconf is not enabled
authorRazvan Becheriu <razvan@isc.org>
Thu, 10 Feb 2022 19:12:11 +0000 (21:12 +0200)
committerRazvan Becheriu <razvan@isc.org>
Thu, 10 Feb 2022 19:40:42 +0000 (21:40 +0200)
src/bin/keactrl/keactrl.in

index 32a5c65fc69210c50e022dbdd8ba6ed402b79539..7c5b10d90cc0c1f8afaf4d578fa5225dcbae328c 100644 (file)
@@ -294,8 +294,11 @@ 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
@@ -385,7 +388,11 @@ do
             # Validate that the specified server names are correct.
             for s in ${servers}
             do
-                is_in_list "${s}" "all dhcp4 dhcp6 dhcp_ddns ctrl_agent netconf"
+                server_list="all dhcp4 dhcp6 dhcp_ddns ctrl_agent"
+                if ${have_netconf}; then
+                    server_list="${server_list} netconf"
+                fi
+                is_in_list "${s}" "${server_list}"
                 if [ "${_inlist}" -eq 0 ]; then
                     log_error "invalid server name: ${s}"
                     exit 1