35 lines
1.2 KiB
Bash
35 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Wrapper script for install, for easier execution via URL.
|
|
|
|
source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
|
|
source /dev/stdin <<< "$(curl -sL http://go.scity.us/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 -execute "CREATE DATABASE unifi"
|
|
influx -host localhost -port 8086 -execute "CREATE USER unifipoller WITH PASSWORD 'unifipoller' WITH ALL PRIVILEGES"
|
|
influx -host localhost -port 8086 -execute "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 |