Created
May 17, 2023 14:11
-
-
Save jlcarruda/bd6463fdcee525211901db6f39fb4333 to your computer and use it in GitHub Desktop.
Check if tmux and docker service is running
This file contains 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
MAIN_TMUX_SESSION="$(tmux ls | awk '{print substr($1, 1, length($1)-1)}')" | |
if [[ -z $MAIN_TMUX_SESSION ]] then | |
/usr/bin/tmux new-session -s main; | |
#else | |
# /usr/bin/tmux attach -t main; | |
fi | |
# Check if docker service is running | |
IS_DOCKER_RUNNING="$(service docker status | grep 'Docker is running')" | |
if [[ -z $IS_DOCKER_RUNNING ]]; then | |
printf "Starting docker ...\n" | |
sudo /usr/sbin/service docker start | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment