Update install.sh

This commit is contained in:
Kroese 2024-02-04 17:20:06 +01:00 committed by GitHub
parent 55f197db00
commit 367f70bd28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -525,18 +525,25 @@ extractESD() {
local iso="$1"
local dir="$2"
local size desc
local size size_gb space space_gb desc
desc=$(printVersion "$VERSION")
local msg="Extracting $desc bootdisk..."
info "$msg" && html "$msg"
size=$(stat -c%s "$iso")
size_gb=$(( (size + 1073741823)/1073741824 ))
space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
space_gb=$(( (space + 1073741823)/1073741824 ))
if ((size<10000000)); then
error "Invalid ESD file: Size is smaller than 10 MB" && exit 62
fi
if (( size > space )); then
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && exit 63
fi
rm -rf "$dir"
mkdir -p "$dir"
@ -606,6 +613,14 @@ extractImage() {
local desc="downloaded ISO"
local size size_gb space space_gb
if [[ "${iso,,}" == *".esd" ]]; then
if ! extractESD "$iso" "$dir"; then
error "Failed to extract ESD file!"
exit 67
fi
return 0
fi
if [[ "$EXTERNAL" != [Yy1]* ]] && [ -z "$CUSTOM" ]; then
desc=$(printVersion "$VERSION")
[ -z "$desc" ] && desc="downloaded ISO"