mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-16 01:42:22 +00:00
Update import-disk-image.sh
This commit is contained in:
parent
4720f9a9e0
commit
81cb2bc9b8
@ -7,8 +7,9 @@ source "/usr/local/share/proxmenux/utils.sh"
|
|||||||
IMAGES_DIR="/var/lib/vz/template/images/"
|
IMAGES_DIR="/var/lib/vz/template/images/"
|
||||||
|
|
||||||
# Check if there are any images in the directory
|
# Check if there are any images in the directory
|
||||||
if [ -z "$(ls -A "$IMAGES_DIR" | grep -E "\.(img|qcow2|vmdk)$")" ]; then
|
IMAGES=$(ls -A "$IMAGES_DIR" | grep -E "\.(img|qcow2|vmdk)$")
|
||||||
whiptail --title "$(translate 'No Images Found')" --msgbox "$(translate 'No compatible disk images found in') $IMAGES_DIR\n\n$(translate 'Please add some images and try again.')" 10 60
|
if [ -z "$IMAGES" ]; then
|
||||||
|
whiptail --title "$(translate 'No Images Available')" --msgbox "$(translate 'No disk images available for import in') $IMAGES_DIR\n\n$(translate 'Supported formats: .img, .qcow2, .vmdk')\n\n$(translate 'Please add some images and try again.')" 12 60
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -43,7 +44,10 @@ fi
|
|||||||
|
|
||||||
# 2. Select disk images
|
# 2. Select disk images
|
||||||
msg_info "$(translate 'Scanning for disk images...')"
|
msg_info "$(translate 'Scanning for disk images...')"
|
||||||
IMAGES=$(ls "$IMAGES_DIR" | grep -E "\.(img|qcow2|vmdk)$")
|
if [ -z "$IMAGES" ]; then
|
||||||
|
msg_error "$(translate 'No compatible disk images found in') $IMAGES_DIR"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
msg_ok "$(translate 'Disk images found')"
|
msg_ok "$(translate 'Disk images found')"
|
||||||
|
|
||||||
IMAGE_LIST=""
|
IMAGE_LIST=""
|
||||||
@ -105,3 +109,4 @@ done
|
|||||||
|
|
||||||
msg_ok "$(translate 'All selected images have been processed')"
|
msg_ok "$(translate 'All selected images have been processed')"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user