Update utils.sh

This commit is contained in:
Kroese 2025-03-18 12:39:08 +01:00 committed by GitHub
parent 85d6f554a3
commit a0efc824bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,4 +146,18 @@ cpu() {
return 0
}
hasDisk() {
[ -b "/disk" ] && return 0
[ -b "/disk1" ] && return 0
[ -b "/dev/disk1" ] && return 0
[ -b "${DEVICE:-}" ] && return 0
[ -z "${DISK_NAME:-}" ] && DISK_NAME="data"
[ -s "$STORAGE/$DISK_NAME.img" ] && return 0
[ -s "$STORAGE/$DISK_NAME.qcow2" ] && return 0
return 1
}
return 0