@cryptotaxi247 / netdata-1 / commits / cac596c72

properly show error messages if auto-update cannot be installed

Costa Tsaousis (ktsaou) committed May 22, 2017 at 12:38 UTC cac596c72c74807a9510e0373710c3704cfdf3a8
1 file changed +6 -3
netdata-installer.sh
+6 -3
@@ -1283,15 +1283,18 @@ REINSTALL
1283 else
1284 echo >&2 "${TPUT_DIM}Run this to automatically check and install netdata updates once per day:${TPUT_RESET}"
1285 echo >&2
1286 - echo >&2 "${TPUT_YELLOW}${TPUT_BOLD}ln -s ${PWD}/netdata-updater.sh ${crondir}/netdata-updater${TPUT_RESET}"
1286 + echo >&2 "${TPUT_YELLOW}${TPUT_BOLD}sudo ln -s ${PWD}/netdata-updater.sh ${crondir}/netdata-updater${TPUT_RESET}"
1287 fi
1288 - elif [ "${AUTOUPDATE}" = "1" ]
1289 - then
1288 + else
1289 progress "Refreshing netdata-updater at cron"
1290 run rm "${crondir}/netdata-updater"
1291 run ln -s "${PWD}/netdata-updater.sh" "${crondir}/netdata-updater"
1292 fi
1293 + else
1294 + [ "${AUTOUPDATE}" = "1" ] && echo >&2 "Cannot figure out the cron directory to install netdata-updater."
1295 fi
1296 + else
1297 + [ "${AUTOUPDATE}" = "1" ] && echo >&2 "You need to run the installer as root for auto-updating via cron."
1298 fi
1299 else
1300 [ -f "netdata-updater.sh" ] && rm "netdata-updater.sh"