mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update import-disk-image.sh
This commit is contained in:
parent
f721d9d774
commit
a6c2b958a2
@ -154,12 +154,20 @@ for IMAGE in $SELECTED_IMAGES; do
|
|||||||
|
|
||||||
if [ "$IMPORT_STATUS" -eq 0 ]; then
|
if [ "$IMPORT_STATUS" -eq 0 ]; then
|
||||||
msg_ok "$(translate 'Image imported successfully')"
|
msg_ok "$(translate 'Image imported successfully')"
|
||||||
|
|
||||||
IMPORTED_DISK=$(cat "$TEMP_DISK_FILE")
|
IMPORTED_DISK=$(cat "$TEMP_DISK_FILE")
|
||||||
rm -f "$TEMP_DISK_FILE"
|
rm -f "$TEMP_DISK_FILE"
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$IMPORTED_DISK" != *:* ]]; then
|
||||||
|
IMPORTED_DISK="${STORAGE}:${IMPORTED_DISK##*/}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$IMPORTED_DISK" ]; then
|
if [ -n "$IMPORTED_DISK" ]; then
|
||||||
EXISTING_DISKS=$(qm config "$VMID" | grep -oP "${INTERFACE}\d+" | sort -n)
|
EXISTING_DISKS=$(qm config "$VMID" | grep -oP "${INTERFACE}\d+" | sort -n)
|
||||||
NEXT_SLOT=0
|
NEXT_SLOT=0
|
||||||
|
|
||||||
|
|
||||||
[[ -n "$EXISTING_DISKS" ]] && NEXT_SLOT=$(( $(echo "$EXISTING_DISKS" | tail -n1 | sed "s/${INTERFACE}//") + 1 ))
|
[[ -n "$EXISTING_DISKS" ]] && NEXT_SLOT=$(( $(echo "$EXISTING_DISKS" | tail -n1 | sed "s/${INTERFACE}//") + 1 ))
|
||||||
|
|
||||||
SSD_OPTION=""
|
SSD_OPTION=""
|
||||||
@ -191,4 +199,4 @@ done
|
|||||||
|
|
||||||
msg_ok "$(translate 'All selected images have been processed')"
|
msg_ok "$(translate 'All selected images have been processed')"
|
||||||
msg_success "$(translate "Press Enter to return to menu...")"
|
msg_success "$(translate "Press Enter to return to menu...")"
|
||||||
read -r
|
read -r
|
||||||
|
Loading…
x
Reference in New Issue
Block a user