Skip to content

Instantly share code, notes, and snippets.

@haarts
Created December 9, 2016 19:05
Show Gist options
  • Save haarts/85f0139355ebb45efea37533c3e98666 to your computer and use it in GitHub Desktop.
Save haarts/85f0139355ebb45efea37533c3e98666 to your computer and use it in GitHub Desktop.
function verify_container_running --argument-names container
set container_status (curl -s -k --cert ~/.config/lxc/client.crt --key ~/.config/lxc/client.key https://localhost:8443/1.0/containers/$container | jq '.metadata.status')
if [ $container_status != "\"Running\"" ]
lxc start $container
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment