Homelab
Contents Files
bash

docker-recover.sh

425 B 14 lines Modified View on GitHub Download
bash
systemctl stop dockercp /$FOLDER/docker.service /lib/systemd/system/docker.servicesystemctl daemon-reloadsystemctl restart docker # Check the status of the Docker serviceSTATUS=$(systemctl is-active docker) # Get the count of running containersCONTAINER_COUNT=$(docker ps -q | wc -l) # Display the status and container countecho "Docker service status: $STATUS"echo "Number of running containers: $CONTAINER_COUNT"