X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=blobdiff_plain;f=netdata-installer.sh;h=6b672a242e8ad5c04d45a1dfa832e496860e1e33;hp=f926f14f2809ed7610673729ece7dd2fc8cdf973;hb=909e26f825bc1f6f907231761412c885331fec7e;hpb=e3fe7e2ef42eaa7e039db54612c6c736da7d96fa diff --git a/netdata-installer.sh b/netdata-installer.sh index f926f14f..6b672a24 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -1354,7 +1354,7 @@ if [ -t 2 ] else # we are headless # create a temporary file for the log - tmp=\$(mktemp /tmp/netdata-updater-log-XXXXXX.log) + tmp=\$(mktemp /tmp/netdata-updater.log.XXXXXX) # open fd 3 and send it to tmp exec 3>\${tmp} fi @@ -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" ] + 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${TPUT_RESET}" + fi fi elif [ -f "netdata-updater.sh" ] then