From ec15deea4de4b4f431fdda5990e8afa83a9805dc Mon Sep 17 00:00:00 2001 From: Griffen8280 <42878642+Griffen8280@users.noreply.github.com> Date: Mon, 1 Nov 2021 11:53:38 -0400 Subject: [PATCH] Create unpoller-installer.sh This file is needed to pull the config file that unpoller will need for startup. --- unpoller-install.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 unpoller-install.sh diff --git a/unpoller-install.sh b/unpoller-install.sh new file mode 100644 index 0000000..7611427 --- /dev/null +++ b/unpoller-install.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +function error { + echo -e "\\e[91m$1\\e[39m" + exit 1 +} + +function check_internet() { + printf "Checking if you are online..." + wget -q --spider http://github.com + if [ $? -eq 0 ]; then + echo "Online. Continuing." + else + error "Offline. Go connect to the internet then run the script again." + fi +} + +check_internet + +echo "Creating directories..." +sudo mkdir -p /portainer/Files/AppData/Config/unpoller || error "Failed to create config directory!" +echo "Downloading Prometheus config files" +sudo wget -O /portainer/Files/AppData/Config/unpoller/up.conf https://raw.githubusercontent.com/novaspirit/pi-hosted/tree/master/pi-hosted_template/configs/up.conf || error "Failed to download up.conf file!" +echo "Done You are ready to goto next step in the install document"