Check Docker is installed or not

This commit is contained in:
2025-01-02 09:52:52 +09:00
parent 3691d31e17
commit 4c99a1c8bd
3 changed files with 48 additions and 2 deletions
+20 -2
View File
@@ -12,6 +12,24 @@ source "${SCRIPT_DIR}/lib/docker.sh"
source "${SCRIPT_DIR}/lib/caddy.sh"
source "${SCRIPT_DIR}/lib/wordpress.sh"
# Check if Docker is installed
if ! command_exists docker; then
install_docker
# Verify installation
if ! command_exists docker; then
echo "Docker installation failed. Please install Docker manually."
exit 1
fi
fi
# Check if Docker service is running
if ! systemctl is-active --quiet docker; then
echo "Docker service is not running. Starting Docker..."
sudo systemctl start docker
fi
# Function to install a new WordPress site
install_site() {
@@ -243,11 +261,11 @@ case "$1" in
;;
*)
echo "KazeW - PWordPress Site Management Script"
echo "KazeWP - WordPress Site Management Script"
echo "Usage:"
echo " $0 install <domain> - Install a new WordPress site"
echo " $0 list - List all installed WordPress sites"
echo " $0 delete <domain> - Delete a WordPress site"
echo " $0 delete <domain> - Delete a WordPress site"
echo " $0 delete all - Delete everything"
exit 1
;;