#!/usr/bin/env bash# SPDX-License-Identifier: GPL-3.0+exportPATH="${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
uniquepath(){localpath=""whilereaddoif[[!"${path}"=~(^|:)"${REPLY}"(:|$)]]then[!-z"${path}"]&&path="${path}:"path="${path}${REPLY}"fidone<<(echo"${PATH}"|tr":""\n")[!-z"${path}"]&&[["${PATH}"=~/bin]]&&[["${PATH}"=~/sbin]]&&exportPATH="${path}"}
uniquepath
netdata_source_dir="$(pwd)"installer_dir="$(dirname"${0}")"if["${netdata_source_dir}"!="${installer_dir}"-a"${installer_dir}"!="."]thenecho>&2"Warning: you are currently in '${netdata_source_dir}' but the installer is in '${installer_dir}'."fi# -----------------------------------------------------------------------------# reload the user profile[-f/etc/profile]&&./etc/profile
# make sure /etc/profile does not change our current directorycd"${netdata_source_dir}"||exit1# -----------------------------------------------------------------------------# load the required functionsif[-f"${installer_dir}/installer/functions.sh"]thensource"${installer_dir}/installer/functions.sh"