Tyleo-Scripts/irp-arch

46 lines
2.3 KiB
Text
Raw Normal View History

2024-02-18 18:06:30 +00:00
#!/usr/bin/env bash
if ! command -v pacman &> /dev/null
then
echo "Systéme non PACMAN-ARCH - Lancement annulé"
echo "Script incompatible. Vérifiez sur:"
echo "https://tyleodev.fr/scripts-crees-par-tyleo/"
exit
fi
echo -------------------------------------------------------------
curl https://static.tyleodev.fr/astra/banner-arch
echo Version 2.1 - Script de Déploiement Public avec FISH et HTOP.
echo Ce script configure Cockpit et active la WebUI sur le port 9090 général.
echo -------------------------------------------------------------
echo "[INFO] Updating Pacman Database and Update System to latest Roll..."
sudo pacman -q -Syyu --noconfirm yay fish htop
echo "[INFO] Installing Packages for Cockpit Linux Web Administration Interface with plugins PCP, StorageD and PackageKit..."
sudo pacman -q -Sy --noconfirm cockpit cockpit-storaged cockpit-packagekit cockpit-pcp
echo "[INFO] Enabling Cockpit Socket (WebUI on ALL:9090)"
sudo systemctl enable cockpit.socket
sudo systemctl start cockpit.socket
echo "[INFO] Installing Packages for Docker, Docker-Compose..."
sudo pacman -q -Sy --noconfirm docker docker-compose docker-machine
echo "[INFO] Enabling Docker Socket for Run (No WebSocket - /var/run/docker.socket)..."
sudo systemctl enable docker.socket
sudo systemctl enable docker
sudo systemctl start docker.socket
sudo systemctl start docker
echo "[INFO] Configuring Portainer.IO controller and WatchTower module..."
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
sudo usermod -a -G docker $USER
sudo chown $USER:docker /var/run/docker.sock
sudo docker volume create portainer_data
sudo docker container stop portainer
sudo docker container rm portainer
sudo docker run -d -p 8000:8000 -p 10443:9443 --name portainer --hostname host.portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest
sudo docker container stop watchtower
sudo docker container rm watchtower
sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name watchtower --restart=always containrrr/watchtower:latest
echo "[INFO] Enabling Quicksudo on $USER..."
sudo echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
echo Quick Sudo installed for $USER user.
echo "[INFO] OPERATION TERMINEE - SYSTEME PRET"