Skip to content

Instantly share code, notes, and snippets.

@lcherone
Created September 20, 2017 04:15
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 lcherone/1eda50411442cd46189a01898f123c28 to your computer and use it in GitHub Desktop.
Save lcherone/1eda50411442cd46189a01898f123c28 to your computer and use it in GitHub Desktop.
LXD stop all running containers
#!/bin/bash
#
# Stop all running containers
#
# stop running containers
for container in $(lxc list volatile.last_state.power=RUNNING -c n --format csv); do
lxc stop "$container"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment