summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpackaging/installer/kickstart.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh
index 60fd3c91c0..991eac8ed1 100755
--- a/packaging/installer/kickstart.sh
+++ b/packaging/installer/kickstart.sh
@@ -368,6 +368,15 @@ trap 'trap_handler 15 0' TERM
# ======================================================================
# Utility functions
+cannonical_path() {
+ cd "$(dirname "${1}")" || exit 1
+ case "$(basename "${1}")" in
+ ..) dirname "$(pwd -P)" ;;
+ .) pwd -P ;;
+ *) echo "$(pwd -P)/$(basename "${1}")" ;;
+ esac
+}
+
setup_terminal() {
TPUT_RESET=""
TPUT_WHITE=""
@@ -886,6 +895,10 @@ detect_existing_install() {
while [ -n "${searchpath}" ]; do
_ndpath="$(PATH="${searchpath}" command -v netdata 2>/dev/null)"
+ if [ -n "${_ndpath}" ]; then
+ _ndpath="$(canonical_path "$(ndpath)")"
+ fi
+
if [ -z "${ndpath}" ] && [ -n "${_ndpath}" ]; then
ndpath="${_ndpath}"
elif [ -n "${_ndpath}" ] && [ "${ndpath}" != "${_ndpath}" ]; then