This commit is contained in:
YAWAsau
2021-11-14 09:08:59 +08:00
parent cc5f8b2687
commit baae8c298a
4 changed files with 32 additions and 20 deletions

View File

@@ -5,7 +5,11 @@ bin_path="$tools_path/bin"
[[ $(echo "$MODDIR" | grep -v 'mt') = "" ]] && echo "我他媽骨灰給你揚了撒了TM不解壓縮用毛線 憨批" && exit 1
[[ ! -d $tools_path ]] && echo " $tools_path目錄遺失" && exit 1
. "$bin_path/bin.sh"
[[ $(find "$MODDIR" -maxdepth 1 -name "*.zip" -type f) = "" ]] && echoRgb "警告 未找到任何zip 請將下載的備份腳本.zip\n -放入當前目錄中\n -當前路徑$MODDIR" "0"
if [[ $(find "$MODDIR" -maxdepth 1 -name "*.zip" -type f) = "" ]]; then
echoRgb "警告 未找到任何zip 請將下載的備份腳本.zip\n -放入當前目錄中\n -當前路徑$MODDIR" "0"
else
[[ $(find "$MODDIR" -maxdepth 1 -name "*.zip" -type f | wc -l) -gt 1 ]] && echoRgb "錯誤 請刪除當前目錄多餘zip\n -保留一個最新的數據備份.zip\n -下列為當期目錄zip\n$(find "$MODDIR" -maxdepth 1 -name "*.zip" -type f)" "0" && exit 1
fi
find "$MODDIR" -maxdepth 1 -name "*.zip" -type f | while read; do
if [[ $(unzip -l "$REPLY" | awk '{print $4}' | grep -oE "^backup_settings.conf$") != "" ]]; then
unzip -o "$REPLY" -d "$MODDIR" && (