Last active
February 28, 2022 05:14
-
-
Save gabbygobln/5ed4c3da351f628779cd63787b7d55cb to your computer and use it in GitHub Desktop.
Revisions
-
gabbygobln revised this gist
Feb 28, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ dockoff () { sleep 1 echo -e "\nDocker (and services) stopped [✔]\n" else echo -e "\nUh oh, something went wrong.. [✗]\n" fi } -
gabbygobln revised this gist
Feb 28, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ docker_state=$(systemctl is-active docker) dockon () { sudo systemctl start containerd && sudo systemctl start docker if (($containerd_state == "active")) && (($docker_state == "active")) then clear sleep 1 -
gabbygobln created this gist
Feb 28, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ #!/bin/bash # My simple bash script to turn on, off, and check state of docker and containerd # by dn0r containerd_state=$(systemctl is-active containerd) docker_state=$(systemctl is-active docker) dockon () { sudo systemctl start containerd && sudo systemctl start docker if (($containerd_state== "active")) && (($docker_state == "active")) then clear sleep 1 echo -e "\nSuccess [✔]\n" else echo -e \n"Failed [✗]\n" fi } dockoff () { sudo systemctl stop containerd && sudo systemctl stop docker if (($containerd_state == "inactive")) && (($docker_state == "inactive")) then clear sleep 1 echo -e "\nDocker (and services) stopped [✔]\n" else echo "\nUh oh, something went wrong.. [✗]\n" fi } dockstat () { echo -e "\nContainerd: ${containerd_state}" echo -e "\nDocker: ${docker_state}\n" } commands () { echo -e "\nList of commands:" echo "----------------" echo -e "\non - turns on containerd & docker" echo -e "\noff - turns off containerd & docker" echo -e "\nstat - returns service status of docker & containred\n" } case "$1" in $null | "") echo "For commands, use the flag 'help'";; "help") commands;; "on") dockon;; "off") dockoff;; "stat") dockstat;; esac