diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-12-28 20:08:30 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-12-28 20:08:30 +0800 |
commit | 51344fd4ffce9298b976255890edec6f214845a4 (patch) | |
tree | 5db4c441def40b8e2179781353b2402e42fdcf5b /distro/debian | |
parent | d44f8aa5b0241150be607de76b5c612cf61ac767 (diff) | |
download | liveusb-builder-51344fd4ffce9298b976255890edec6f214845a4.tar.xz |
a common hashfile verify function
Diffstat (limited to 'distro/debian')
-rw-r--r-- | distro/debian/isoinfo.common | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/distro/debian/isoinfo.common b/distro/debian/isoinfo.common index 44da88b..3ab1727 100644 --- a/distro/debian/isoinfo.common +++ b/distro/debian/isoinfo.common @@ -2,20 +2,10 @@ _isover=9.6.0 ISONAME="$DISTRONAME $_isover amd64 ${_desktop}" ISOURL="${_isover}-live/amd64/iso-hybrid/debian-live-${_isover}-amd64-${_desktop,,}.iso" -VERIFY=sha512chk +HASHTOOL=sha512sum +HASHFILE=distro/debian/SHA512SUMS +VERIFY=hashfile mirrorlist=( https://mirrors.tuna.tsinghua.edu.cn/debian-cd http://mirrors.ustc.edu.cn/debian-cd ) - -sha512chk() { - local _cksum _hashsum - _cksum=$(sha512sum "$ISOPATH/$ISOFILE" | cut -d' ' -f1) - _hashsum=$(grep "${ISOFILE}\$" distro/debian/SHA512SUMS | cut -d' ' -f1) - - if [[ $_cksum == $_hashsum ]]; then - msg "$ISOFILE ok." - else - msg "$ISOFILE checksum bad!" && return 1 - fi -} |