Skip to content

Commit

Permalink
proxmox: wip reset/restore preserving data
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Aug 5, 2024
1 parent 003e1f7 commit f1bebd0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions install/local/install-scrypted-proxmox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ then
VMID=10443
fi

if [ -n "$SCRYPTED_RESTORE" ]
then
RESTORE_VMID=$VMID
$VMID="10444 --force"
fi

echo "Downloading scrypted container backup."
if [ ! -f "$SCRYPTED_TAR_ZST" ]
then
Expand Down Expand Up @@ -75,6 +81,20 @@ else
echo "$CONF not found? Start on boot must be enabled manually."
fi

if [ -n "$RESTORE_VMID" ]
then
echo "Preparing rootfs reset..."
pct set 10444 --delete mp0
pct set 10444 --delete unused0
pct move-volume $RESTORE_VMID mp0 --target-vmid 10444 --target-volume mp0
rm *.tar
vzdump $RESTORE_VMID --dumpdir /tmp
echo "Moving data volume to backup..."
pct restore 10444 *.tar $@

# todo: back to VMID...
fi

echo "Adding udev rule: /etc/udev/rules.d/65-scrypted.rules"
readyn "Add udev rule for hardware acceleration? This may conflict with existing rules."
if [ "$yn" == "y" ]
Expand Down

0 comments on commit f1bebd0

Please sign in to comment.