added kickstart-static64.sh
Costa Tsaousis (ktsaou) committed
May 27, 2017 at 21:54 UTC
e8164dbd905c1753e2cab43bcd7dc369f03d98e3
1 file changed
+37
kickstart-static64.sh
new
+37
@@ -0,0 +1,37 @@
1
+#!/usr/bin/env sh
2
+
3
+if [ "$(uname -m)" != "x86_64" ]
4
+ then
5
+ echo >&2 "Static binary versions of netdata are available only for 64bit Intel/AMD CPUs (x86_64), but yours is: $(uname -m)."
6
+ exit 1
7
+fi
8
+
9
+if [ "$(uname -s)" != "Linux" ]
10
+ then
11
+ echo >&2 "Static binary versions of netdata are available only for Linux, but this system is $(uname -s)"
12
+ exit 1
13
+fi
14
+
15
+BASE='https://raw.githubusercontent.com/firehol/binary-packages/master'
16
+
17
+echo >&2 "Checking the latest version of static build..."
18
+LATEST="$(curl -Ss "${BASE}/netdata-latest.gz.run")"
19
+
20
+if [ -z "${LATEST}" ]
21
+ then
22
+ echo >&2 "Cannot find the latest static binary version of netdata."
23
+ exit 1
24
+fi
25
+
26
+echo >&2 "Downloading static netdata binary: ${LATEST}"
27
+curl "${BASE}/${LATEST}" >"/tmp/${LATEST}"
28
+if [ $? -ne 0 ]
29
+ then
30
+ echo >&2 "Failed to download the latest static binary version of netdata."
31
+ exit 1
32
+fi
33
+chmod 755 "/tmp/${LATEST}"
34
+
35
+echo >&2 "Executing the downloaded self-extracting archive"
36
+sudo sh "/tmp/${LATEST}"
37
+