-
-
Save Streek/d187a3e6ae0e12bd43c00d8369e83583 to your computer and use it in GitHub Desktop.
Start or stop all docker containers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Operation starting..." | |
if [[ $1 == "s" || $1 == "start" ]]; then | |
echo "--Starting All Docker Containers--" | |
docker start $(docker ps -a -q) | |
echo "All Containers Started..." | |
fi | |
if [[ $1 == "e" || $1 == "k" || $1 == "kill" || $1 == "stop" || $1 == "end" ]]; then | |
echo "--Killing All Docker Containers--" | |
docker stop $(docker ps -a -q) | |
echo "All Containers Killed..." | |
fi | |
echo "...Operation Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment