Last active
November 2, 2021 21:35
-
-
Save chemputer/0bf96966a76ab9306473d78ccd09bcfb to your computer and use it in GitHub Desktop.
Bulk Proxmox Container Template Download "pveam download all"
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 | |
# | |
# Title: pveam download all - pveamall.sh | |
# Description: Automates downloading all of the available container images via the Proxmox tool pveam, with options for selectivity for certain categories. | |
# Author: Chemputer | |
# Date: Nov 2nd, 2021 | |
# | |
# simply put the name of the storage, like local, or whatever you named it. | |
storage="raid5nfs" | |
#storage="local" | |
# enable with a 1, disable category with a 0. | |
mail=0 | |
system=1 | |
turnkeylinux=1 | |
# enable/disable updating pveam database before downloading, only really useful to disable for testing. | |
update=1 | |
if (( $update )); | |
then | |
pveam update | |
fi | |
if (( $mail )); | |
then | |
pveam available --section mail | xargs -0 | awk '{print $2;}' | while read template; do pveam download $storage $template; done | |
fi | |
if (( $system )); | |
then | |
pveam available --section system | xargs -0 | awk '{print $2;}' | while read template; do pveam download $storage $template; done | |
fi | |
if (( $turnkeylinux )); | |
then | |
pveam available --section turnkeylinux | xargs -0 | awk '{print $2;}' | while read template; do pveam download $storage $template; done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment