Last active
September 22, 2025 21:39
-
-
Save david-shepard/9dc21db3f773e18ea66e82496fcd486e to your computer and use it in GitHub Desktop.
Reuse a LXC Container Config in Proxmox
This file contains hidden or 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 | |
| if [[ "$#" != 2 ]]; then | |
| echo "Usage $0 <config path> <hostname>" | |
| exit 1 | |
| fi | |
| mapfile -t configs < <(ls -1 /etc/pve/lxc/) | |
| last_config="${configs[-1]%%.*}" | |
| new_config=$((last_config+1)) | |
| pct create "$new_config" local:vztmpl/ubuntu-20.04-standard_20.04.1-1_amd64.tar.gz \ | |
| --config "$1" \ | |
| --hostname "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment