summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2024-04-10 13:08:10 -0400
committerGitHub <noreply@github.com>2024-04-10 13:08:10 -0400
commit2293a52b7e86353e83dcaf400093cc76795e2fe3 (patch)
treef9cd06403e54a1f5e2e2a08937b31e0464f94c04
parent0237612f275c65ae3993813ae55d19bc98c09eb5 (diff)
Fix logic in detection of multiple installs. (#17369)
- Only flag multiple installs if subsequent searches produce a different install path. - Only set the detected install path if a search actually finds an install path. - Bail early if the initial search finds nothing.
-rwxr-xr-xpackaging/installer/kickstart.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh
index 437d9ecfd1..60fd3c91c0 100755
--- a/packaging/installer/kickstart.sh
+++ b/packaging/installer/kickstart.sh
@@ -886,14 +886,16 @@ detect_existing_install() {
while [ -n "${searchpath}" ]; do
_ndpath="$(PATH="${searchpath}" command -v netdata 2>/dev/null)"
- if [ -z "${ndpath}" ]; then
+ if [ -z "${ndpath}" ] && [ -n "${_ndpath}" ]; then
ndpath="${_ndpath}"
- elif [ -n "${_ndpath}" ]; then
+ elif [ -n "${_ndpath}" ] && [ "${ndpath}" != "${_ndpath}" ]; then
fatal "Multiple installs of Netdata agent detected (located at '${ndpath}' and '${_ndpath}'). Such a setup is not generally supported. If you are certain you want to operate on one of them despite this, use the '--install-prefix' option to specifiy the install you want to operate on." F0517
fi
if [ -n "${INSTALL_PREFIX}" ] && [ -n "${ndpath}" ]; then
break
+ elif [ -z "${_ndpath}" ]; then
+ break
elif echo "${searchpath}" | grep -v ':'; then
searchpath=""
else