mirror of
https://github.com/10h30/kazewp.git
synced 2026-05-12 23:31:27 +09:00
Check Docker is installed or not
This commit is contained in:
@@ -1,5 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to install Docker
|
||||
install_docker() {
|
||||
echo -n "Docker is not installed. Do you want to install Docker? (y/n): "
|
||||
read answer
|
||||
|
||||
if [ "$answer" != "${answer#[Yy]}" ]; then
|
||||
echo "Installing Docker..."
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh > /dev/null 2>&1
|
||||
sudo sh get-docker.sh > /dev/null 2>&1
|
||||
rm get-docker.sh > /dev/null 2>&1
|
||||
|
||||
# Add current user to docker group
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
#newgrp docker
|
||||
|
||||
echo "Docker has been installed successfully!"
|
||||
else
|
||||
echo "Docker installation skipped. Please install Docker manually to use this script."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
check_container_running() {
|
||||
docker ps --format '{{.Names}}' | grep -q "^$1$"
|
||||
return $?
|
||||
|
||||
@@ -5,6 +5,10 @@ function generate_password() {
|
||||
}
|
||||
export -f generate_password
|
||||
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
function save_credentials() {
|
||||
local WP_PROJECT_DIR=$1
|
||||
local DOMAIN=$2
|
||||
|
||||
Reference in New Issue
Block a user