File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 9797fi
9898
9999# 4. Docker Check & Install
100+ check_docker_status () {
101+ if systemctl is-active --quiet docker; then
102+ return 0
103+ else
104+ echo -e " ${BLUE} Starting Docker service...${NC} "
105+ systemctl start docker
106+ if systemctl is-active --quiet docker; then
107+ return 0
108+ fi
109+ fi
110+ return 1
111+ }
112+
100113if ! command -v docker & > /dev/null; then
101114 echo -e " ${BLUE} Docker not found. Installing via official script...${NC} "
102115 curl -fsSL https://get.docker.com | bash
103116 systemctl enable docker
104- systemctl start docker
105- echo -e " ${GREEN} Docker installed.${NC} "
117+
118+ if check_docker_status; then
119+ echo -e " ${GREEN} Docker installed and started successfully.${NC} "
120+ else
121+ echo -e " ${RED} Error: Docker installed but failed to start.${NC} "
122+ echo -e " ${YELLOW} Please check logs: journalctl -xeu docker.service${NC} "
123+ echo -e " ${YELLOW} You may need to install Docker manually.${NC} "
124+ exit 1
125+ fi
106126else
107127 echo -e " ${GREEN} Docker detected.${NC} "
128+ if ! check_docker_status; then
129+ echo -e " ${RED} Error: Docker is installed but not running and failed to start.${NC} "
130+ echo -e " ${YELLOW} Please check logs: journalctl -xeu docker.service${NC} "
131+ exit 1
132+ fi
108133fi
109134
110135# 5. Handover to setup-services.sh
You can’t perform that action at this time.
0 commit comments