Skip to content

Commit 18b27c3

Browse files
committed
feat: verify docker service status after install/detection
1 parent 928dc87 commit 18b27c3

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

download-and-install.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,39 @@ else
9797
fi
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+
100113
if ! 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
106126
else
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
108133
fi
109134

110135
# 5. Handover to setup-services.sh

0 commit comments

Comments
 (0)