Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
update packages for arch linux nspawn container
nspawn-execute() {
pid=$(machinectl -a -l status $1 | grep Leader | awk '{print $2}');
echo "Execute on $1: nsenter -t $pid -m -i -n -p ${@:2}";
nsenter -t $pid -m -i -n -p "${@:2}";
nspawn-execute-all() {
for i in $(machinectl list | grep nspawn | awk '{print $1}');
nspawn-execute $i "${@:1}";
yes | nspawn-execute-all pacman -Syu
yes | nspawn-execute-all pacman -Scc
nspawn-execute-all pacman-optimize

This comment has been minimized.

Copy link
Owner Author

@nosada nosada commented May 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment