Add 'install-unifi-poller'
This commit is contained in:
35
install-unifi-poller
Normal file
35
install-unifi-poller
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user