Case insensitive when checking checksum value.

This commit is contained in:
longpanda
2021-10-25 09:29:51 +08:00
parent a93b0f6656
commit e713946fd0
2 changed files with 38 additions and 5 deletions

View File

@@ -5,8 +5,8 @@ if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" ]; then
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" vtReadChecksum
if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck MD5 value with .md5 file. [ OK ]"
else
echo -e "\n\nCheck MD5 value with .md5 file. [ FAIL ]"
@@ -33,7 +33,7 @@ if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" ]; then
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" vtReadChecksum
if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA1 value with .sha1 file. [ OK ]"
else
echo -e "\n\nCheck SHA1 value with .sha1 file. [ FAIL ]"
@@ -62,7 +62,7 @@ if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" ]; then
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" vtReadChecksum
if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA256 value with .sha256 file. [ OK ]"
else
echo -e "\n\nCheck SHA256 value with .sha256 file. [ FAIL ]"
@@ -91,7 +91,7 @@ if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" ]; then
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" vtReadChecksum
if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA512 value with .sha512 file. [ OK ]"
else
echo -e "\n\nCheck SHA512 value with .sha512 file. [ FAIL ]"