#!/bin/sh echo '1. Check bak file' if [ ! -f "scz_offline.7z.bak" ];then echo "备份文件不存在" else echo 'will delete the file :scz_offline.7z.bak...' rm -f scz_offline.7z.bak echo 'del finish.' fi echo '2. make bak file' mv scz_offline.7z scz_offline.7z.bak echo '3.download new file' wget http://scz.617.cn:8/offline/scz_offline.7z new=`md5sum scz_offline.7z|cut -d ' ' -f1` old=`md5sum scz_offline.7z.bak|cut -d ' ' -f1` if [ $new=$old ]; then echo "The new file is the same as the old one." else echo "the new file is more new,will unzip" 7z x scz_offline.7z fi