From 2a72895d7a7be71d6eefee193ce22e80718ee253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 17 Jan 2023 15:24:40 +0100 Subject: tools/influxdb-monitoring.sh: fix token creation --- tools/influxdb-monitoring.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/influxdb-monitoring.sh b/tools/influxdb-monitoring.sh index f83f792..612900f 100755 --- a/tools/influxdb-monitoring.sh +++ b/tools/influxdb-monitoring.sh @@ -3,7 +3,7 @@ # telemetries. set -eu -if ! command -v influx jq pass; then +if ! command -v influx >/dev/null || ! command -v jq >/dev/null || ! command -v pass >/dev/null; then exec nix shell 'nixpkgs#influxdb2' 'nixpkgs#jq' 'nixpkgs#pass' -c "$0" "$@" fi @@ -31,7 +31,7 @@ ensure_token() { pass_path="nixos-secrets/influxdb/token/$hostname" if ! token="$(pass "$pass_path" 2>/dev/null)" \ || ! token_is_valid "$token"; then - influx auth create -d "monitoring-$hostname" --write-buckets --json \ + influx auth create "${influx_args[@]}" -o "personal" -d "monitoring-$hostname" --write-buckets --json \ | jq -r '.token' \ | sed 's/^\(.*\)$/\1\n\1/' \ | pass insert -f "$pass_path" -- cgit v1.2.3