#!/usr/bin/env bash if [ -f ~/.homestead-features/wsl_user_name ]; then WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" else WSL_USER_NAME=vagrant WSL_USER_GROUP=vagrant fi export DEBIAN_FRONTEND=noninteractive if [ -f /home/$WSL_USER_NAME/.homestead-features/influxdb ] then echo "influxdb already installed." exit 0 fi # InfluxDB v2.7.5 - from https://www.influxdata.com/downloads/ # influxdata-archive_compat.key GPG fingerprint: # 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E wget -q https://repos.influxdata.com/influxdata-archive_compat.key echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list apt-get update apt-get install -y influxdb2 systemctl enable --now influxdb influx setup \ --force \ --username "homestead" \ --password "secretkey" \ --org "homestead" \ --bucket "homestead" \ --name "homestead" \ --token "homestead_secret" touch /home/$WSL_USER_NAME/.homestead-features/influxdb chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features