Last active
July 25, 2023 10:08
-
-
Save maurerle/552f7f22221eb15a2fd115fa4bc32450 to your computer and use it in GitHub Desktop.
Script to create a (Offloader) VM directly from the Freifunk Gluon x86-64 Firmware Download
This file contains 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 | |
# makes a template vm from URL | |
# call like ./make-ff-proxmox-template.sh 9000 http://firmware-server/factory/gluon-v2022.1.2-x86-64.img.gz | |
ID=$1 | |
URL=$2 | |
FS=lvm | |
wget $URL -O firmware.img.gz | |
gzip -df firmware.img.gz | |
qm create $ID --memory 128 --net0 virtio,bridge=vmbr0 --net1 virtio,bridge=vmbr0,tag=97 --scsihw virtio-scsi-pci | |
qm importdisk $ID ./firmware.img local-$FS | |
[ "$FS" == "btrfs" ] && qm set $ID --scsi0 local-$FS:$ID/vm-$ID-disk-0.raw | |
[ "$FS" == "lvm" ] && qm set $ID --scsi0 local-$FS:vm-$ID-disk-0 | |
qm set $ID --serial0 socket --vga serial0 --name ff-template | |
qm set $ID --boot order=scsi0 | |
qm template $ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment