Skip to content

Instantly share code, notes, and snippets.

@antonkomarev
Last active March 8, 2022 20:48
Show Gist options
  • Select an option

  • Save antonkomarev/bd0b980473929f26bb66e8295a60739f to your computer and use it in GitHub Desktop.

Select an option

Save antonkomarev/bd0b980473929f26bb66e8295a60739f to your computer and use it in GitHub Desktop.
Restart docker on MacOS, quick git commands
# vi ~/.bash_profile
# Docker
d () {
if [ -f $1 ] ; then
echo 'Commands available:'
echo '\e[32m d restart \e[0m'
return 0
fi
if [ $1 = "restart" ]; then
test -z "$(killall docker 2>/dev/null)" && osascript -e 'quit app "Docker"'
open --background -a Docker
return 0
else
echo "Unknown argument: $1"
return 1
fi
}
# vi ~/.zshrc
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment