summaryrefslogtreecommitdiffstats
path: root/netdata-installer.sh
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2022-02-18 20:35:14 -0500
committerGitHub <noreply@github.com>2022-02-18 20:35:14 -0500
commita24f5bd75c1d720cd31f4c4defb25ba010f17269 (patch)
tree0e482ea95501f573dd49915a3733486e7a371bab /netdata-installer.sh
parent698f01fb06efc02ee3d81b4fa68315f8497e9bda (diff)
Revert "Overhaul handling of auto-updates in the installer code. (#12076)" (#12182)
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-xnetdata-installer.sh26
1 files changed, 24 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh
index f1115ac410..158c8f8391 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -226,6 +226,9 @@ USAGE: ${PROGRAM} [options]
--install <path> Install netdata in <path>. Ex. --install /opt will put netdata in /opt/netdata.
--dont-start-it Do not (re)start netdata after installation.
--dont-wait Run installation in non-interactive mode.
+ --auto-update or -u Install netdata-updater in cron to automatically check for updates once per day.
+ --auto-update-type Override the auto-update scheduling mechanism detection, currently supported types
+ are: systemd, interval, crontab.
--stable-channel Use packages from GitHub release pages instead of nightly updates.
This results in less frequent updates.
--nightly-channel Use most recent nightly updates instead of GitHub releases.
@@ -298,6 +301,7 @@ HEREDOC
DONOTSTART=0
DONOTWAIT=0
+AUTOUPDATE=0
NETDATA_PREFIX=
LIBS_ARE_HERE=0
NETDATA_ENABLE_ML=""
@@ -315,8 +319,19 @@ while [ -n "${1}" ]; do
"--dont-scrub-cflags-even-though-it-may-break-things") DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS=1 ;;
"--dont-start-it") DONOTSTART=1 ;;
"--dont-wait") DONOTWAIT=1 ;;
- "--auto-update" | "-u") ;;
- "--auto-update-type") ;;
+ "--auto-update" | "-u") AUTOUPDATE=1 ;;
+ "--auto-update-type")
+ AUTO_UPDATE_TYPE="$(echo "${2}" | tr '[:upper:]' '[:lower:]')"
+ case "${AUTO_UPDATE_TYPE}" in
+ systemd|interval|crontab)
+ shift 1
+ ;;
+ *)
+ echo "Unrecognized value for --auto-update-type. Valid values are: systemd, interval, crontab"
+ exit 1
+ ;;
+ esac
+ ;;
"--stable-channel") RELEASE_CHANNEL="stable" ;;
"--nightly-channel") RELEASE_CHANNEL="nightly" ;;
"--enable-plugin-freeipmi") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-plugin-freeipmi)}" | sed 's/$/ --enable-plugin-freeipmi/g')" ;;
@@ -1881,6 +1896,13 @@ progress "Installing (but not enabling) the 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 "${AUTO_UPDATE_TYPE}" || run_failed "Cannot enable netdata updater tool"
+else
+ disable_netdata_updater || run_failed "Cannot disable netdata updater tool"
+fi
+
# -----------------------------------------------------------------------------
progress "Wrap up environment set up"