mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35:49 +00:00
Update mido.sh
This commit is contained in:
parent
8ec6945b54
commit
142ee3f1c6
1 changed files with 5 additions and 3 deletions
|
|
@ -516,14 +516,15 @@ downloadFile() {
|
||||||
local size="$4"
|
local size="$4"
|
||||||
local lang="$5"
|
local lang="$5"
|
||||||
local desc="$6"
|
local desc="$6"
|
||||||
local rc total progress domain dots space folder
|
local rc total total_gb progress domain dots space folder
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
|
|
||||||
if [ -n "$size" ] && [[ "$size" != "0" ]]; then
|
if [ -n "$size" ] && [[ "$size" != "0" ]]; then
|
||||||
folder=$(dirname -- "$iso")
|
folder=$(dirname -- "$iso")
|
||||||
space=$(df --output=avail -B 1 "$folder" | tail -n 1)
|
space=$(df --output=avail -B 1 "$folder" | tail -n 1)
|
||||||
(( size > space )) && error "Not enough free space left to download file!" && return 1
|
total_gb=$(formatBytes "$space")
|
||||||
|
(( size > space )) && error "Not enough free space to download file, only $total_gb left!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if running with interactive TTY or redirected to docker log
|
# Check if running with interactive TTY or redirected to docker log
|
||||||
|
|
@ -553,8 +554,9 @@ downloadFile() {
|
||||||
|
|
||||||
if (( rc == 0 )) && [ -f "$iso" ]; then
|
if (( rc == 0 )) && [ -f "$iso" ]; then
|
||||||
total=$(stat -c%s "$iso")
|
total=$(stat -c%s "$iso")
|
||||||
|
total_gb=$(formatBytes "$total")
|
||||||
if [ "$total" -lt 100000000 ]; then
|
if [ "$total" -lt 100000000 ]; then
|
||||||
error "Invalid download link: $url (is only $total bytes?). Please report this at $SUPPORT/issues." && return 1
|
error "Invalid download link: $url (is only $total_gb ?). Please report this at $SUPPORT/issues." && return 1
|
||||||
fi
|
fi
|
||||||
verifyFile "$iso" "$size" "$total" "$sum" || return 1
|
verifyFile "$iso" "$size" "$total" "$sum" || return 1
|
||||||
html "Download finished successfully..." && return 0
|
html "Download finished successfully..." && return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue