File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,18 @@ backup_files_and_cookie_auth_code() {
371
371
echo -e " ${RED} 备份.env文件失败。${NC} "
372
372
exit 1
373
373
fi
374
+
375
+ # 备份map.txt文件
376
+ local map_txt_path=" $REPO_DIR /$PROJECT_NAME /config/map.txt"
377
+ local map_txt_backup_file=" map.txt.backup_$( date +%Y%m%d) "
378
+ echo -e " ${YELLOW} 正在备份map.txt文件...${NC} "
379
+ cp " $map_txt_path " " ./$map_txt_backup_file "
380
+ if [ $? -eq 0 ]; then
381
+ echo -e " ${GREEN} map.txt文件已备份为 $map_txt_backup_file ${NC} "
382
+ else
383
+ echo -e " ${RED} 备份map.txt文件失败。${NC} "
384
+ exit 1
385
+ fi
374
386
}
375
387
376
388
# 定义恢复函数
@@ -408,6 +420,23 @@ restore_env_json_and_cookie_auth_code() {
408
420
echo -e " ${RED} 备份文件 $env_backup_file 不存在,无法恢复.env文件。${NC} "
409
421
exit 1
410
422
fi
423
+
424
+ # 恢复map.txt文件
425
+ local map_txt_backup_file=" map.txt.backup_$( date +%Y%m%d) "
426
+ if [ -f " ./$map_txt_backup_file " ]; then
427
+ echo -e " ${YELLOW} 正在恢复map.txt文件...${NC} "
428
+ cp " ./$map_txt_backup_file " " $REPO_DIR /$PROJECT_NAME /config/map.txt"
429
+ if [ $? -eq 0 ]; then
430
+ echo -e " ${GREEN} map.txt文件已恢复。${NC} "
431
+ rm " ./$map_txt_backup_file " # 删除备份文件
432
+ else
433
+ echo -e " ${RED} 恢复map.txt文件失败。${NC} "
434
+ exit 1
435
+ fi
436
+ else
437
+ echo -e " ${RED} 备份文件 $map_txt_backup_file 不存在,无法恢复map.txt文件。${NC} "
438
+ exit 1
439
+ fi
411
440
}
412
441
413
442
# 尝试次数限制,避免无限循环
You can’t perform that action at this time.
0 commit comments