]> arthur.barton.de Git - netdata.git/blobdiff - netdata-installer.sh
Merge pull request #1968 from ktsaou/master
[netdata.git] / netdata-installer.sh
index ee2aded15f327ee36f0d1de1da5867f9d31f2927..f926f14f2809ed7610673729ece7dd2fc8cdf973 100755 (executable)
@@ -104,6 +104,18 @@ Valid <installer options> are:
         Enable/disable the FreeIPMI plugin.
         Default: enable it when libipmimonitoring is available.
 
+   --enable-plugin-nfacct
+   --disable-plugin-nfacct
+
+        Enable/disable the nfacct plugin.
+        Default: enable it when libmnl and libnetfilter_acct are available.
+
+   --enable-lto
+   --disable-lto
+
+        Enable/disable Link-Time-Optimization
+        Default: enabled
+
    --zlib-is-really-here
    --libs-are-really-here
 
@@ -199,6 +211,22 @@ do
         then
         NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --disable-plugin-freeipmi"
         shift 1
+    elif [ "$1" = "--enable-plugin-nfacct" ]
+        then
+        NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --enable-plugin-nfacct"
+        shift 1
+    elif [ "$1" = "--disable-plugin-nfacct" ]
+        then
+        NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --disable-plugin-nfacct"
+        shift 1
+    elif [ "$1" = "--enable-lto" ]
+        then
+        NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --enable-lto"
+        shift 1
+    elif [ "$1" = "--disable-lto" ]
+        then
+        NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --disable-lto"
+        shift 1
     elif [ "$1" = "--help" -o "$1" = "-h" ]
         then
         usage
@@ -493,6 +521,24 @@ then
     fi
 fi
 
+config_signature_matches() {
+    local md5="${1}" file="${2}"
+
+    if [ "${BASH_VERSINFO[0]}" -ge "4" ]
+        then
+        [ "${configs_signatures[${md5}]}" = "${file}" ] && return 0
+        return 1
+    fi
+
+    if [ -f "configs.signatures" ]
+        then
+        grep "\['${md5}'\]='${file}'" "configs.signatures" >/dev/null
+        return $?
+    fi
+
+    return 1
+}
+
 # backup user configurations
 installer_backup_suffix="${PID}.${RANDOM}"
 for x in $(find "${NETDATA_PREFIX}/etc/netdata/" -name '*.conf' -type f)
@@ -520,19 +566,13 @@ do
                 cp "conf.d/${f}" "${x}.orig"
             fi
 
-            if [ "${BASH_VERSINFO[0]}" -ge "4" ]
-            then
-                if [ "${configs_signatures[${md5}]}" = "${f}" ]
+            if config_signature_matches "${md5}" "${f}"
                 then
-                    # it is a stock version - don't keep it
-                    echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' is stock version."
-                else
-                    # edited by user - keep it
-                    echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' ${TPUT_RED} has been edited by user${TPUT_RESET}. Keeping it."
-                    run cp -p "${x}" "${x}.installer_backup.${installer_backup_suffix}"
-                fi
+                # it is a stock version - don't keep it
+                echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' is stock version."
             else
-                echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' ${TPUT_RET}cannot be checked for custom edits${TPUT_RESET}. Keeping it."
+                # edited by user - keep it
+                echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' ${TPUT_RED} has been edited by user${TPUT_RESET}. Keeping it."
                 run cp -p "${x}" "${x}.installer_backup.${installer_backup_suffix}"
             fi
         fi