# 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