From 00b2e6d14498314e5c2d113ec9ea8e132a0586ab Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sun, 19 Mar 2017 00:08:49 +0200 Subject: [PATCH] netdata-installer.sh suggest daily updates --- netdata-installer.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/netdata-installer.sh b/netdata-installer.sh index 72eece0a..8713c8b9 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -1434,11 +1434,19 @@ REINSTALL echo >&2 echo >&2 "${TPUT_DIM}${TPUT_BOLD}netdata-updater.sh${TPUT_RESET}${TPUT_DIM} can work from cron. It will trigger an email from cron" echo >&2 "only if it fails (it does not print anything if it can update netdata).${TPUT_RESET}" - if [ "${UID}" -eq 0 -a -d "/etc/cron.daily" -a ! -f "/etc/cron.daily/netdata-updater.sh" ] - then - echo >&2 "${TPUT_DIM}Run this to automatically check and install netdata updates once per day:${TPUT_RESET}" - echo >&2 - echo >&2 "${TPUT_YELLOW}${TPUT_BOLD}ln -s ${PWD}/netdata-updater.sh /etc/cron.daily/netdata-updater.sh${TPUT_RESET}" + if [ "${UID}" -eq "0" ] + then + if [ -d "/etc/cron.daily" -a ! -f "/etc/cron.daily/netdata-updater.sh" ] + then + echo >&2 "${TPUT_DIM}Run this to automatically check and install netdata updates once per day:${TPUT_RESET}" + echo >&2 + echo >&2 "${TPUT_YELLOW}${TPUT_BOLD}ln -s ${PWD}/netdata-updater.sh /etc/cron.daily/netdata-updater.sh${TPUT_RESET}" + elif [ -d "/etc/periodic/daily" -a ! -f "/etc/periodic/daily/netdata-updater.sh" ] + then + echo >&2 "${TPUT_DIM}Run this to automatically check and install netdata updates once per day:${TPUT_RESET}" + echo >&2 + echo >&2 "${TPUT_YELLOW}${TPUT_BOLD}ln -s ${PWD}/netdata-updater.sh /etc/periodic/daily/netdata-updater.sh${TPUT_RESET}" + fi fi elif [ -f "netdata-updater.sh" ] then -- 2.39.2