summaryrefslogtreecommitdiffstats
path: root/netdata-installer.sh
diff options
context:
space:
mode:
authorPaul Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-03-19 13:12:26 +0100
committerGitHub <noreply@github.com>2019-03-19 13:12:26 +0100
commit8490795d63347e61c55a9fe5e2480ab7997c44b3 (patch)
tree06d8ea530e09a164d285a2d6a9217d5267f2b50f /netdata-installer.sh
parent2925b27d2a2c2c218ecc88ca5fa6aaecb5422a34 (diff)
Patch netdata-installer.sh to avoid unwanted errors during stock config cleanup (#5571)
* netdata/installer: minor fixes on config file lookup Adjust the find command so that: 1) Excludes hidden files, we do not have any configs hidden so its just noise in the results 2) Make sure we are looking at .conf files. All netdata configs are .conf * netdata/installer: Wrap up the fix for #5039 1) Fix find command, missed a dash. Also missed a double quote 2) Extend find further to include the rest of the potential files (TODO: To confirm whether these *installer_backup* files are from previous versions, so need to check them for removal) 3) Make sure you remove the orig part from the start of the remaining path name, so that we can find the respective signature * Adjust the colouring, keep filenames with the same color and mark read only the error message * Add missing python.d config file signatures * netdata/packaging/installer: add new go.d signatures for newly added configs * netdata/signatures: More configuration signatures add/updates * netdata/packaging/installer: Exclude orig folder, it only contains stock configurations that we always keep latest regardless of change * Revert "netdata/signatures: More configuration signatures add/updates" This reverts commit b790ea2ed567af82530b1d8201cfe0c46fc2a6f9. (Was agreed to remove the addtions, since we diverted to a different way and that was to ignore all files inside orig folder as we dont need to check them) * Revert "netdata/packaging/installer: add new go.d signatures for newly added configs" This reverts commit 561b3ca5f5b28124804ebd69dc7d7c09803e90bd. (Was agreed to remove the addtions, since we diverted to a different way and that was to ignore all files inside orig folder as we dont need to check them) * Revert "Add missing python.d config file signatures" This reverts commit 77d1ba3f98cdde894fa95d7f1ee8ebaec50ac718. (Was agreed to remove the addtions, since we diverted to a different way and that was to ignore all files inside orig folder as we dont need to check them)
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-xnetdata-installer.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh
index 374fbf3a64..f9cb67e2a5 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -525,7 +525,7 @@ if [ ! -f "${NETDATA_PREFIX}/etc/netdata/.installer-cleanup-of-stock-configs-don
}
# clean up stock config files from the user configuration directory
- for x in $(find -L "${NETDATA_PREFIX}/etc/netdata" -type f); do
+ for x in $(find -L "${NETDATA_PREFIX}/etc/netdata" -type f -not -path '*/\.*' -not -path "${NETDATA_PREFIX}/etc/netdata/orig/*" \( -name '*.conf.old' -o -name '*.conf' -o -name '*.conf.orig' -o -name '*.conf.installer_backup.*' \)); do
if [ -f "${x}" ]; then
# find it relative filename
f="${x/${NETDATA_PREFIX}\/etc\/netdata\//}"
@@ -534,6 +534,7 @@ if [ ! -f "${NETDATA_PREFIX}/etc/netdata/.installer-cleanup-of-stock-configs-don
t="${f/.conf.installer_backup.*/.conf}"
t="${t/.conf.old/.conf}"
t="${t/.conf.orig/.conf}"
+ t="${t/orig\//}"
if [ -z "${md5sum}" -o ! -x "${md5sum}" ]; then
# we don't have md5sum - keep it
@@ -549,7 +550,7 @@ if [ ! -f "${NETDATA_PREFIX}/etc/netdata/.installer-cleanup-of-stock-configs-don
deleted_stock_configs=$((deleted_stock_configs + 1))
else
# edited by user - keep it
- echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' ${TPUT_RED} does not match stock of '${t}'${TPUT_RESET}. Keeping it."
+ echo >&2 "File '${TPUT_CYAN}${x}${TPUT_RESET}' ${TPUT_RED} does not match stock of${TPUT_RESET} ${TPUT_CYAN}'${t}'${TPUT_RESET}. Keeping it."
fi
fi
fi