Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # update all containers
- # list of container ids we need to iterate through
- containers=$(pct list | tail -n +2 | cut -f1 -d' ')
- function update_container() {
- container=$1
- echo "Updating $container..."
- # to chain commands within one exec we will need to wrap them in bash
- pct exec $container -- bash -c "apt update && apt upgrade -y"
- }
- for container in $containers
- do
- update_container $container
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement