Skip to content

Instantly share code, notes, and snippets.

@JoshuaEstes
Last active August 29, 2015 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshuaEstes/4b04f29f70b66303afd8 to your computer and use it in GitHub Desktop.
Save JoshuaEstes/4b04f29f70b66303afd8 to your computer and use it in GitHub Desktop.
Useful Oneliners

Vagrant

# Gettting the state of the machine, ie Is it poweroff or running

vagrant status --machine-readable | awk -F',' '$3 == "state" { print $4 }'

Can be used in a script like so

if test "poweroff" == $(vagrant status --machine-readable | awk -F',' '$3 == "state" { print $4 }'); then echo "yup"; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment