Update netdata-updater.sh
Paweł Krupa committed
Feb 25, 2019 at 21:43 UTC
e11ffb482980bef8f182b6160d58884d0c313ce9
1 file changed
+3
-5
packaging/installer/netdata-updater.sh
+3
-5
@@ -21,7 +21,7 @@ error() {
21
}
22
23
# this is what we will do if it fails (head-less only)
24
-failed() {
24
+fatal() {
25
error "FAILED TO UPDATE NETDATA : ${1}"
26
27
if [ -n "${logfile}" ]; then
@@ -39,7 +39,7 @@ download() {
39
elif command -v wget >/dev/null 2>&1; then
40
wget -T 15 -O - "${url}" >"${dest}" || fatal "Cannot download ${url}"
41
else
42
- failed "I need curl or wget to proceed, but neither is available on this system."
42
+ fatal "I need curl or wget to proceed, but neither is available on this system."
43
fi
44
}
45
@@ -105,8 +105,7 @@ EOF
105
source "${ENVIRONMENT_FILE}" || exit 1
106
107
if [ "${INSTALL_UID}" != "$(id -u)" ]; then
108
- echo >&2 "You are running this script as user with uid $(id -u). We recommend to run this script as root (user with uid 0)"
109
- exit 1
108
+ fatal "You are running this script as user with uid $(id -u). We recommend to run this script as root (user with uid 0)"
109
fi
110
111
logfile=
@@ -122,6 +121,5 @@ else
121
exec 3>"${logfile}"
122
fi
123
125
-
124
# the installer updates this script - so we run and exit in a single line
125
update && exit 0