„install.sh“ ändern
This commit is contained in:
parent
1833b7a32b
commit
d7a8d4b377
20
install.sh
20
install.sh
@ -9,13 +9,13 @@ fi
|
|||||||
# Check which Linux distribution is installed
|
# Check which Linux distribution is installed
|
||||||
if [ -f /etc/debian_version ]; then
|
if [ -f /etc/debian_version ]; then
|
||||||
echo "Detected Debian-based system."
|
echo "Detected Debian-based system."
|
||||||
DISTRO=debian
|
DISTRO="debian"
|
||||||
elif [ -f /etc/redhat-release ]; then
|
elif [ -f /etc/redhat-release ]; then
|
||||||
echo "Detected Red Hat-based system."
|
echo "Detected Red Hat-based system."
|
||||||
DISTRO=redhat
|
DISTRO="redhat"
|
||||||
elif [ -f /etc/alpine-release ]; then
|
elif [ -f /etc/alpine-release ]; then
|
||||||
echo "Detected Alpine Linux."
|
echo "Detected Alpine Linux."
|
||||||
DISTRO=alpine
|
DISTRO="alpine"
|
||||||
else
|
else
|
||||||
echo "Unsupported Linux distribution."
|
echo "Unsupported Linux distribution."
|
||||||
exit 1
|
exit 1
|
||||||
@ -23,12 +23,12 @@ fi
|
|||||||
|
|
||||||
# Install Docker
|
# Install Docker
|
||||||
echo "Installing Docker..."
|
echo "Installing Docker..."
|
||||||
if [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ubuntu" ]; then
|
if [ "$DISTRO" = "debian" ] || [ "$DISTRO" = "ubuntu" ]; then
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y docker.io
|
apt-get install -y docker.io
|
||||||
elif [ "$DISTRO" == "redhat" ]; then
|
elif [ "$DISTRO" = "redhat" ]; then
|
||||||
yum install -y docker
|
yum install -y docker
|
||||||
elif [ "$DISTRO" == "alpine" ]; then
|
elif [ "$DISTRO" = "alpine" ]; then
|
||||||
apk add docker
|
apk add docker
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -38,15 +38,15 @@ systemctl start docker
|
|||||||
|
|
||||||
# Install Docker Compose
|
# Install Docker Compose
|
||||||
read -p "Do you want to install Docker Compose? (y/n) " INSTALL_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..."
|
echo "Installing Docker Compose..."
|
||||||
if [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ubuntu" ]; then
|
if [ "$DISTRO" = "debian" ] || [ "$DISTRO" = "ubuntu" ]; then
|
||||||
apt-get install -y docker-compose
|
apt-get install -y docker-compose
|
||||||
elif [ "$DISTRO" == "redhat" ]; then
|
elif [ "$DISTRO" = "redhat" ]; then
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
yum install -y python-pip
|
yum install -y python-pip
|
||||||
pip install docker-compose
|
pip install docker-compose
|
||||||
elif [ "$DISTRO" == "alpine" ]; then
|
elif [ "$DISTRO" = "alpine" ]; then
|
||||||
apk add py-pip
|
apk add py-pip
|
||||||
pip install docker-compose
|
pip install docker-compose
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user