-
-
Save UtahDave/a2c378e059fcb1b6a84ccfce3c1f6e9b to your computer and use it in GitHub Desktop.
LXD run command in all running containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Run command in all running containers | |
# Usage: $ ./lxc-exec-all.sh apt update && apt upgrade | |
# | |
for container in $(lxc list volatile.last_state.power=RUNNING -c n --format csv); do | |
lxc exec "$container" "$@" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment