From adcb0f28eb81610b7c07295d7980d69a15c2b582 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Apr 2020 22:23:18 -0500 Subject: [PATCH] Add 'install-unifi-poller' --- install-unifi-poller | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 install-unifi-poller diff --git a/install-unifi-poller b/install-unifi-poller new file mode 100644 index 0000000..b9059f5 --- /dev/null +++ b/install-unifi-poller @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Wrapper script for install, for easier execution via URL. + +source /dev/stdin <<< "$(curl -sL http://scity.xyz/colorsinc)" +source /dev/stdin <<< "$(curl -sL http://scity.xyz/defaultinc)" + + +if [ "$EUID" -ne 0 ]; then APTFUNC="sudo ${ATYPE}" +else APTFUNC="${ATYPE}" +fi +echo "" +echo -e "${idsCL[LightGreen]}UniFi-Poller Setup Script${idsCL[Default]}" + +sudo echo "deb https://repos.influxdata.com/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/influxdb.list +sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add - +sudo apt -y update +sudo apt install -y influxdb +sudo systemctl start influxdb + +influx -host localhost -port 8086 CREATE DATABASE unifi +influx -host localhost -port 8086 CREATE USER unifipoller WITH PASSWORD 'unifipoller' WITH ALL PRIVILEGES +influx -host localhost -port 8086 GRANT ALL ON unifi TO unifipoller + +curl -s https://golift.io/gpgkey | sudo apt-key add - +sudo echo deb https://dl.bintray.com/golift/ubuntu bionic main | sudo tee /etc/apt/sources.list.d/unifi-pollers.list +sudo apt update +sudo apt install unifi-poller + + +echo "" +echo -e "${idsCL[Yellow]}UniFi-Poller has been Installed${idsCL[Default]}" +echo "" +echo "" + +exit 0 \ No newline at end of file