aboutsummaryrefslogtreecommitdiff
path: root/bin/influx
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2023-10-23 18:37:21 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2023-10-23 18:37:21 +0200
commitc73a53806b95d2d2908b67611a709afc8c980c2e (patch)
treee9ca6938ef1378665fdb8a863045129f9e60a916 /bin/influx
parentebe35b94b059343849e0c428ee69378190f25030 (diff)
downloadinfra-c73a53806b95d2d2908b67611a709afc8c980c2e.tar.gz
infra-c73a53806b95d2d2908b67611a709afc8c980c2e.tar.bz2
infra-c73a53806b95d2d2908b67611a709afc8c980c2e.tar.xz
infra-c73a53806b95d2d2908b67611a709afc8c980c2e.zip
influx
Diffstat (limited to 'bin/influx')
-rwxr-xr-xbin/influx41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/influx b/bin/influx
new file mode 100755
index 0000000..537d771
--- /dev/null
+++ b/bin/influx
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+v=2.7.3
+
+set -euo pipefail
+
+basedir="${0%/*}"
+self="${0##*/}"
+
+s=$(uname -s)
+case "$s"
+in
+ Darwin) s=darwin ;;
+ Linux) s=linux ;;
+ *) echo "Unsupported system: $s" >/dev/stderr; exit 1 ;;
+esac
+
+m=$(uname -m)
+case "$m"
+in
+ x86_64) m=amd64 ;;
+ arm64) ;;
+ *) echo "Unsupported machine: $m" >/dev/stderr; exit 1 ;;
+esac
+
+url="https://dl.influxdata.com/influxdb/releases/influxdb2-client-${v}-${s}-${m}.tar.gz"
+
+tar="$basedir/.$self/$self-${v}.tar.gz"
+bin="$basedir/.$self/$self-${v}/$self"
+
+if [[ ! -x "$bin" ]]
+then
+ mkdir -p "${tar%/*}"
+ wget -O "$tar" "$url"
+
+ mkdir -p "${bin%/*}"
+ tar xf "$tar" -C "${bin%/*}"
+ chmod +x "$bin"
+fi
+
+exec "$bin" "${@}"