„install.sh“ ändern

This commit is contained in:
Yann Mölle 2023-04-17 20:51:27 +02:00
parent 1833b7a32b
commit d7a8d4b377

View File

@ -9,13 +9,13 @@ fi
# Check which Linux distribution is installed
if [ -f /etc/debian_version ]; then
echo "Detected Debian-based system."
DISTRO=debian
DISTRO="debian"
elif [ -f /etc/redhat-release ]; then
echo "Detected Red Hat-based system."
DISTRO=redhat
DISTRO="redhat"
elif [ -f /etc/alpine-release ]; then
echo "Detected Alpine Linux."
DISTRO=alpine
DISTRO="alpine"
else
echo "Unsupported Linux distribution."
exit 1
@ -23,12 +23,12 @@ fi
# Install Docker
echo "Installing Docker..."
if [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ubuntu" ]; then
if [ "$DISTRO" = "debian" ] || [ "$DISTRO" = "ubuntu" ]; then
apt-get update
apt-get install -y docker.io
elif [ "$DISTRO" == "redhat" ]; then
elif [ "$DISTRO" = "redhat" ]; then
yum install -y docker
elif [ "$DISTRO" == "alpine" ]; then
elif [ "$DISTRO" = "alpine" ]; then
apk add docker
fi
@ -38,15 +38,15 @@ systemctl start docker
# Install Docker Compose
read -p "Do you want to install Docker Compose? (y/n) " INSTALL_COMPOSE
if [ "$INSTALL_COMPOSE" == "y" ]; then
if [ "$INSTALL_COMPOSE" = "y" ]; then
echo "Installing Docker Compose..."
if [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ubuntu" ]; then
if [ "$DISTRO" = "debian" ] || [ "$DISTRO" = "ubuntu" ]; then
apt-get install -y docker-compose
elif [ "$DISTRO" == "redhat" ]; then
elif [ "$DISTRO" = "redhat" ]; then
yum install -y epel-release
yum install -y python-pip
pip install docker-compose
elif [ "$DISTRO" == "alpine" ]; then
elif [ "$DISTRO" = "alpine" ]; then
apk add py-pip
pip install docker-compose
fi