Upload files to "Tools"
This commit is contained in:
@@ -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/Whoogle || error "Failed to create Whoogle config directory!"
|
||||
echo "Setting permissions..."
|
||||
sudo chown -R 927.927 /portainer/Files/AppData/Config/Whoogle || error "Failed to set permissions!"
|
||||
echo "Done You are ready to install the Whoogle Template"
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
function error {
|
||||
echo -e "\\e[91m$1\\e[39m"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Creating directories..."
|
||||
sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/data || error "Failed to create data folder!"
|
||||
sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/letsencrypt || error "Failed to create letsencrypt folder!"
|
||||
sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/database || error "Failed to create database folder!"
|
||||
echo "Creating a blank nginx-proxy-manager config files"
|
||||
sudo touch /portainer/Files/AppData/Config/nginx-proxy-manager/config.json || error "Failed to touch config.json file!"
|
||||
echo "Setup complete. You can now install the stack using the App Template."
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/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 "Setting permissions..."
|
||||
sudo chown -R root.root /portainer/Files/AppData/Config/ncdata || error "Failed to set permissions!"
|
||||
sudo chown -R 33.33 /portainer/Files/AppData/Config/ncdata/nextcloud || error "Failed to set permissions!"
|
||||
sudo chown -R 33.33 /portainer/Files/AppData/Config/ncdata/ncp || error "Failed to set permissions!"
|
||||
sudo chown -R 101.102 /portainer/Files/AppData/Config/ncdata/database || error "Failed to set permissions!"
|
||||
sudo chmod -R 755 /portainer/Files/AppData/Config/ncdata/ || error "Failed to set permissions!"
|
||||
echo "Permissions are reset to a working config."
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/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/prometheus/config || error "Failed to create config directory!"
|
||||
sudo mkdir -p /portainer/Files/AppData/Config/prometheus/data || error "Failed to create data directory for Prometheus!"
|
||||
sudo mkdir -p /portainer/Files/AppData/Config/grafana/data || error "Failed to create data directory for Grafana!"
|
||||
echo "Downloading Prometheus config files if they don't exist"
|
||||
if [ -d /portainer/Files/AppData/Config/prometheus/config/prometheus.yml ];
|
||||
then
|
||||
echo "/portainer/Files/AppData/Config/prometheus/config/prometheus.yml is a directory removing"
|
||||
rm -rf '/portainer/Files/AppData/Config/prometheus/config/prometheus.yml/'
|
||||
fi
|
||||
|
||||
if [ ! -f /portainer/Files/AppData/Config/prometheus/config/prometheus.yml ];
|
||||
then
|
||||
sudo wget -O /portainer/Files/AppData/Config/prometheus/config/prometheus.yml https://raw.githubusercontent.com/oijkn/Docker-Raspberry-PI-Monitoring/main/prometheus/prometheus.yml || error "Failed to download prometheus.yml file!"
|
||||
fi
|
||||
|
||||
if [ -d /portainer/Files/AppData/Config/grafana/grafana.ini ];
|
||||
then
|
||||
echo "/portainer/Files/AppData/Config/grafana/grafana.ini is a directory removing"
|
||||
rm -rf '/portainer/Files/AppData/Config/grafana/grafana.ini'
|
||||
fi
|
||||
sudo touch /portainer/Files/AppData/Config/grafana/grafana.ini || error "Failed to touch grafana.ini file!"
|
||||
echo "Setting permissions..."
|
||||
sudo chown -R 472:472 /portainer/Files/AppData/Config/grafana/data || error "Failed to set permissions for Grafana data!"
|
||||
echo "Done You are ready to goto next step in the install document"
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
|
||||
portainer_pid=`docker ps | grep portainer/agent | awk '{print $1}'`
|
||||
portainer_name=`docker ps | grep portainer/agent | awk '{print $2}'`
|
||||
|
||||
sudo docker stop $portainer_pid || error "Failed to stop portainer!"
|
||||
sudo docker rm $portainer_pid || error "Failed to remove portainer container!"
|
||||
sudo docker rmi $portainer_name || error "Failed to remove/untag images from the container!"
|
||||
sudo docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest || error "Failed to execute newer version of Portainer Agent!"
|
||||
Reference in New Issue
Block a user