Skip to content

Commit

Permalink
proxmox: find a default storage device
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Dec 10, 2024
1 parent 5396928 commit 9ea4b5a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion install/proxmox/install-scrypted-proxmox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,23 @@ then
fi
fi

if [[ ! "$@" =~ "--storage" ]]
then
HAS_LOCAL_LVM=$(pvesm status | grep local-lvm | grep active)
HAS_LOCAL_ZFS=$(pvesm status | grep local-zfs | grep active)
if [ ! -z "$HAS_LOCAL_LVM" ]
then
RESTORE_STORAGE="--storage local-lvm"
elif [ ! -z "$HAS_LOCAL_ZFS" ]
then
RESTORE_STORAGE="--storage local-zfs"
else
echo "Could not determine a valid storage device. One may need to be specified manually."
fi
fi

pct stop $VMID 2>&1 > /dev/null
pct restore $VMID $SCRYPTED_TAR_ZST $@
pct restore $VMID $SCRYPTED_TAR_ZST $@ $RESTORE_STORAGE

if [ "$?" != "0" ]
then
Expand Down

0 comments on commit 9ea4b5a

Please sign in to comment.