Skip to content

Instantly share code, notes, and snippets.

@psypersky
Forked from peterver/isdockerlive.sh
Created March 13, 2018 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psypersky/64e766609799cdb1b0fff31094c4ecf2 to your computer and use it in GitHub Desktop.
Save psypersky/64e766609799cdb1b0fff31094c4ecf2 to your computer and use it in GitHub Desktop.
A shell script that uses curl to see if docker is up and running
#!/bin/bash
rep=$(curl -s --unix-socket /var/run/docker.sock http://ping > /dev/null)
status=$?
if [ "$status" == "7" ]; then
echo 'not connected'
exit 1
fi
echo 'connected'
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment