Skip to content

Instantly share code, notes, and snippets.

@daveshah
Created December 28, 2021 19:13
Show Gist options
  • Save daveshah/ae776bc6e73796178fba886e41dbd8d5 to your computer and use it in GitHub Desktop.
Save daveshah/ae776bc6e73796178fba886e41dbd8d5 to your computer and use it in GitHub Desktop.
Quick snippet that halts script execution if docker is not up and running.
#!/usr/bin/env bash
if ! docker info > /dev/null 2>&1; then
echo "This script uses docker, and it isn't running - please start docker and try again!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment