mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 21:30:16 +02:00
Adding in some fixes for FreeBSD (tested in a FreeNAS jail 'FreeBSD 11.2-STABLE') as well as a fix for the checksum logic not correctly comparing the checksums. This still needs testing on a MacOS host
This commit is contained in:
parent
e1e722fc5b
commit
f8d60c0011
1 changed files with 11 additions and 5 deletions
|
@ -97,7 +97,7 @@ install_croc()
|
||||||
elif [[ $unameu == *LINUX* ]]; then
|
elif [[ $unameu == *LINUX* ]]; then
|
||||||
croc_os="Linux"
|
croc_os="Linux"
|
||||||
elif [[ $unameu == *FREEBSD* ]]; then
|
elif [[ $unameu == *FREEBSD* ]]; then
|
||||||
croc_os="freebsd"
|
croc_os="FreeBSD"
|
||||||
elif [[ $unameu == *NETBSD* ]]; then
|
elif [[ $unameu == *NETBSD* ]]; then
|
||||||
croc_os="NetBSD"
|
croc_os="NetBSD"
|
||||||
elif [[ $unameu == *OPENBSD* ]]; then
|
elif [[ $unameu == *OPENBSD* ]]; then
|
||||||
|
@ -144,17 +144,23 @@ install_croc()
|
||||||
|
|
||||||
echo "Verifying checksum..."
|
echo "Verifying checksum..."
|
||||||
if [[ $unameu == *DARWIN* ]]; then
|
if [[ $unameu == *DARWIN* ]]; then
|
||||||
checksum="$(shasum -a 256 ${dl}) $croc_file"
|
checksum="$(shasum -a 256 ${dl}) $croc_file)"
|
||||||
|
elif [[ $unameu == "FREEBSD" ]]; then
|
||||||
|
checksum="$(sha256 -q ${dl}) $croc_file"
|
||||||
else
|
else
|
||||||
checksum="$(sha256sum ${dl}) $croc_file"
|
checksum="$(sha256sum ${dl})"
|
||||||
fi
|
fi
|
||||||
checksum_check="$(cat ${dl_checksum} | grep $croc_file) $croc_file"
|
checksum_check="$(cat ${dl_checksum} | grep "${checksum}")"
|
||||||
|
|
||||||
if [[ "$s1" != "$s2" ]]; then
|
if [[ "${checksum}" != "${checksum_check}" ]]; then
|
||||||
echo "${checksum}"
|
echo "${checksum}"
|
||||||
echo "${checksum_check}"
|
echo "${checksum_check}"
|
||||||
echo "checksums are not valid, exiting"
|
echo "checksums are not valid, exiting"
|
||||||
return 7
|
return 7
|
||||||
|
else
|
||||||
|
echo "verified checksum"
|
||||||
|
echo "Downloaded: ${checksum}"
|
||||||
|
echo "Remote: ${checksum_check}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue