mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 04:05:50 +00:00
Update install.sh
This commit is contained in:
parent
c6c487639e
commit
e33cb688c9
1 changed files with 4 additions and 6 deletions
|
|
@ -293,20 +293,18 @@ verifyFile() {
|
||||||
local check="$2"
|
local check="$2"
|
||||||
local hash=""
|
local hash=""
|
||||||
|
|
||||||
|
[ -z "$check" ] && return 0
|
||||||
|
|
||||||
html "Verifying downloaded ISO..."
|
html "Verifying downloaded ISO..."
|
||||||
info "Calculating SHA256 checksum of the ISO file..."
|
info "Calculating SHA256 checksum of the ISO file..."
|
||||||
|
|
||||||
hash=$(sha256sum "$iso" | cut -f1 -d' ')
|
hash=$(sha256sum "$iso" | cut -f1 -d' ')
|
||||||
|
|
||||||
if [ -z "$check" ]; then
|
|
||||||
info "The sha256 checksum is: $hash , but have no value available for comparison." && return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$hash" == "$check" ]]; then
|
if [[ "$hash" == "$check" ]]; then
|
||||||
info "Succesfully verified that the checksum was correct!" && return 0
|
info "Succesfully verified that the checksum was correct!" && return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
error "Invalid sha256 checksum: $hash , expected value is: $check"
|
error "Invalid sha256 checksum: $hash , but expected value is: $check"
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -348,7 +346,7 @@ downloadFile() {
|
||||||
|
|
||||||
if (( rc == 0 )) && [ -f "$iso" ]; then
|
if (( rc == 0 )) && [ -f "$iso" ]; then
|
||||||
if [ "$(stat -c%s "$iso")" -gt 100000000 ]; then
|
if [ "$(stat -c%s "$iso")" -gt 100000000 ]; then
|
||||||
if [[ "$VERIFY" == [Yy1]* ]]; then
|
if [[ "$VERIFY" == [Yy1]* ]] && [ -n "$sum" ]; then
|
||||||
! verifyFile "$iso" "$sum" && return 1
|
! verifyFile "$iso" "$sum" && return 1
|
||||||
fi
|
fi
|
||||||
html "Download finished successfully..." && return 0
|
html "Download finished successfully..." && return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue