mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 20:25:49 +00:00
Update install.sh
This commit is contained in:
parent
2ea826cc4b
commit
908d32db45
1 changed files with 6 additions and 4 deletions
|
|
@ -293,14 +293,16 @@ verifyFile() {
|
||||||
local iso="$1"
|
local iso="$1"
|
||||||
local check="$2"
|
local check="$2"
|
||||||
local hash=""
|
local hash=""
|
||||||
|
local algo="SHA256"
|
||||||
|
|
||||||
[ -z "$check" ] && return 0
|
[ -z "$check" ] && return 0
|
||||||
|
[[ "${#check}" == "40" ]] && algo="SHA1"
|
||||||
|
|
||||||
html "Verifying downloaded ISO..."
|
html "Verifying downloaded ISO..."
|
||||||
info "Calculating SHA256 checksum of the ISO file..."
|
info "Calculating $algo checksum of the ISO file..."
|
||||||
|
|
||||||
if [[ "${#check}" == "40" ]]; then
|
if [[ "${algo,,}" != "sha256" ]]; then
|
||||||
hash=$(shasum "$iso" | cut -f1 -d' ')
|
hash=$(sha1sum "$iso" | cut -f1 -d' ')
|
||||||
else
|
else
|
||||||
hash=$(sha256sum "$iso" | cut -f1 -d' ')
|
hash=$(sha256sum "$iso" | cut -f1 -d' ')
|
||||||
fi
|
fi
|
||||||
|
|
@ -309,7 +311,7 @@ verifyFile() {
|
||||||
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 , but expected value is: $check ! Please report this at $SUPPORT/issues"
|
error "Invalid $algo checksum: $hash , but expected value is: $check ! Please report this at $SUPPORT/issues"
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
return 1
|
return 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue