mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 19:55:49 +00:00
Update install.sh
This commit is contained in:
parent
59403efbb2
commit
939b52dddc
1 changed files with 37 additions and 32 deletions
|
|
@ -272,38 +272,6 @@ getESD() {
|
|||
return 0
|
||||
}
|
||||
|
||||
doMido() {
|
||||
|
||||
local iso="$1"
|
||||
local version="$2"
|
||||
local desc="$3"
|
||||
local rc
|
||||
|
||||
rm -f "$iso"
|
||||
rm -f "$iso.PART"
|
||||
|
||||
local msg="Downloading $desc..."
|
||||
info "$msg" && html "$msg"
|
||||
/run/progress.sh "$iso.PART" "" "Downloading $desc ([P])..." &
|
||||
|
||||
cd "$TMP"
|
||||
{ /run/mido.sh "${version,,}"; rc=$?; } || :
|
||||
cd /run
|
||||
|
||||
fKill "progress.sh"
|
||||
|
||||
if (( rc == 0 )) && [ -f "$iso" ]; then
|
||||
if [ "$(stat -c%s "$iso")" -gt 100000000 ]; then
|
||||
html "Download finished successfully..." && return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f "$iso"
|
||||
rm -f "$iso.PART"
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
verifyFile() {
|
||||
|
||||
local iso="$1"
|
||||
|
|
@ -341,6 +309,43 @@ verifyFile() {
|
|||
return 1
|
||||
}
|
||||
|
||||
doMido() {
|
||||
|
||||
local iso="$1"
|
||||
local version="$2"
|
||||
local desc="$3"
|
||||
local rc sum size total
|
||||
|
||||
rm -f "$iso"
|
||||
rm -f "$iso.PART"
|
||||
|
||||
size=$(getMido "$version" "size")
|
||||
sum=$(getMido "$version" "sum")
|
||||
|
||||
local msg="Downloading $desc..."
|
||||
info "$msg" && html "$msg"
|
||||
/run/progress.sh "$iso.PART" "$size" "Downloading $desc ([P])..." &
|
||||
|
||||
cd "$TMP"
|
||||
{ /run/mido.sh "${version,,}"; rc=$?; } || :
|
||||
cd /run
|
||||
|
||||
fKill "progress.sh"
|
||||
|
||||
if (( rc == 0 )) && [ -f "$iso" ]; then
|
||||
total=$(stat -c%s "$iso")
|
||||
if [ "$total" -gt 100000000 ]; then
|
||||
! verifyFile "$iso" "$size" "$total" "$sum" && return 1
|
||||
html "Download finished successfully..." && return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f "$iso"
|
||||
rm -f "$iso.PART"
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
downloadFile() {
|
||||
|
||||
local iso="$1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue