Browse Source

Remove check for config file in stock conf dir (#12327)

Steve8291 3 years ago
parent
commit
54ef002004
1 changed files with 8 additions and 10 deletions
  1. 8 10
      collectors/ioping.plugin/ioping.plugin.in

+ 8 - 10
collectors/ioping.plugin/ioping.plugin.in

@@ -174,16 +174,14 @@ ioping_opts="-T 1000000"
 # -----------------------------------------------------------------------------
 # load the configuration files
 
-for CONFIG in "${NETDATA_STOCK_CONFIG_DIR}/${plugin}.conf" "${NETDATA_USER_CONFIG_DIR}/${plugin}.conf"
-do
-    if [ -f "${CONFIG}" ]
-        then
-        info "Loading config file '${CONFIG}'..."
-        source "${CONFIG}"
-        [ $? -ne 0 ] && error "Failed to load config file '${CONFIG}'."
-    else
-        warning "Cannot find file '${CONFIG}'."
-    fi
+for CONFIG in "${NETDATA_STOCK_CONFIG_DIR}/${plugin}.conf" "${NETDATA_USER_CONFIG_DIR}/${plugin}.conf"; do
+  if [ -f "${CONFIG}" ]; then
+    info "Loading config file '${CONFIG}'..."
+    source "${CONFIG}"
+    [ $? -ne 0 ] && error "Failed to load config file '${CONFIG}'."
+  elif [[ $CONFIG =~ ^$NETDATA_USER_CONFIG_DIR ]]; then
+    warning "Cannot find file '${CONFIG}'."
+  fi
 done
 
 if [ -z "${destination}" ]