header-logo-left

The Lone Geek Blog

One geek in a sea of nerds.

header-logo-left

Scripting on Proxmox

A few scripts I put together to do some things on proxmox

| Comments

May add more later at some point here or in another post

I wrote a script to download all the avaliable templates for proxmox.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Script to download all proxmox templates

SAVEIFS=$IFS                                # Save current IFS
IFS=$'\n'                                   # Change IFS to new line
list=`pveam available | awk '{print $2}'`   # Get a list of currently available templates
list=($list)                                # Not sure what that does but it works. Thanks stackoverflow users.
IFS=$SAVEIFS                                # Restore IFS

# Do the loop
for (( i=0; i<${#list[@]}; i++ ))
do
    pveam download local "${list[$i]}" # This does the download process to the local volume.
done
exit

Comments