mirror of
https://github.com/koush/scrypted.git
synced 2026-06-11 05:10:30 +01:00
proxmox: wip reset/restore preserving data
This commit is contained in:
@@ -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
|
||||
@@ -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" ]
|
||||
|
||||
Reference in New Issue
Block a user