file=$1
check_md5()
{ unzip -P passwd -o $file $1 md5=$(md5sum $1 | cut -c1-32) md5_in=$(cat md5.txt | grep $1 | cut -c1-32) if [ "$md5" = "$md5_in" ] ; then return 0 else

return 1 fi }

检查文件内MD5是否匹配。

md5.txt由压缩前生成。

 md5sum file1 file2 file3 > md5.txt 

结果为:

5713edb25b10d1f076baef1cf42ece74  file1
123437a6d29a184bbfd97270f52645fc  file2
56783edb25b10d1f076baef1cf42ece74  file3

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2021-06-07
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2021-12-06
  • 2021-06-26
相关资源
相似解决方案