Files
pi-hosted/install_portainer.sh

25 lines
906 B
Bash
Raw Permalink Normal View History

2021-10-07 11:30:24 -04:00
#!/bin/bash
2021-10-06 10:35:41 -04:00
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
2024-06-17 20:08:02 -04:00
sudo mkdir -p /portainer/Files/AppData/Config/portainer || error "Failed to create the Portainer Config Folder"
2021-10-06 10:35:41 -04:00
sudo docker pull portainer/portainer-ce:latest || error "Failed to pull latest Portainer docker image!"
2025-07-22 19:54:19 -04:00
sudo docker run -d -p 9000:9000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /portainer/Files/AppData/Config/portainer:/data portainer/portainer-ce:latest --logo "https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/images/pi-hosted-logo.png" || error "Failed to run Portainer docker image!"
2021-09-16 11:32:18 -04:00