summaryrefslogtreecommitdiffstats
path: root/packaging/makeself
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xpackaging/makeself/install-or-update.sh40
1 files changed, 30 insertions, 10 deletions
diff --git a/packaging/makeself/install-or-update.sh b/packaging/makeself/install-or-update.sh
index 9796eb085..393525554 100755
--- a/packaging/makeself/install-or-update.sh
+++ b/packaging/makeself/install-or-update.sh
@@ -9,6 +9,9 @@ umask 002
# Be nice on production environments
renice 19 $$ >/dev/null 2>/dev/null
+NETDATA_PREFIX="/opt/netdata"
+NETDATA_USER_CONFIG_DIR="${NETDATA_PREFIX}/etc/netdata"
+
# -----------------------------------------------------------------------------
if [ -d /opt/netdata/etc/netdata.old ]; then
progress "Found old etc/netdata directory, reinstating this"
@@ -21,16 +24,17 @@ if [ -d /opt/netdata/etc/netdata.old ]; then
fi
STARTIT=1
-
-while [ ! -z "${1}" ]
-do
- if [ "${1}" = "--dont-start-it" ]
- then
- STARTIT=0
- else
- echo >&2 "Unknown option '${1}'. Ignoring it."
- fi
- shift
+AUTOUPDATE=0
+RELEASE_CHANNEL="nightly"
+
+while [ "${1}" ]; do
+ case "${1}" in
+ "--dont-start-it") STARTIT=0;;
+ "--auto-update"|"-u") AUTOUPDATE=1;;
+ "--stable-channel") RELEASE_CHANNEL="stable";;
+ *) echo >&2 "Unknown option '${1}'. Ignoring it.";;
+ esac
+ shift 1
done
deleted_stock_configs=0
@@ -137,6 +141,22 @@ progress "Install netdata at system init"
install_netdata_service || run_failed "Cannot install netdata init service."
+set_netdata_updater_channel || run_failed "Cannot set netdata updater tool release channel to '${RELEASE_CHANNEL}'"
+
+
+# -----------------------------------------------------------------------------
+progress "Install (but not enable) netdata updater tool"
+cleanup_old_netdata_updater || run_failed "Cannot cleanup old netdata updater tool."
+install_netdata_updater || run_failed "Cannot install netdata updater tool."
+
+progress "Check if we must enable/disable the netdata updater tool"
+if [ "${AUTOUPDATE}" = "1" ]; then
+ enable_netdata_updater || run_failed "Cannot enable netdata updater tool"
+else
+ disable_netdata_updater || run_failed "Cannot disable netdata updater tool"
+fi
+
+
# -----------------------------------------------------------------------------
progress "creating quick links"