This commit is contained in:
YAWAsau
2021-11-02 23:06:49 +08:00
parent c3b67f3e89
commit 3cebbc6017
6 changed files with 32 additions and 47 deletions

View File

@@ -13,14 +13,6 @@ path2="/data/data"
[[ ! -d $path2 ]] && echoRgb "設備不存在user目錄" "0" && exit 1
#記錄開始時間
starttime1="$(date -u "+%s")"
#顯示執行結果
echo_log() {
if [[ $? = 0 ]]; then
echoRgb "$1成功" "1" && result=0
else
echoRgb "$1失敗過世了" "0" && result=1
fi
}
{
Backup_folder="$MODDIR"
if [[ ! -f $Backup_folder/app_details ]]; then
@@ -97,6 +89,7 @@ if [[ $Recovery_mode = true ]]; then
echoRgb "$X不存在 無法恢復$FILE_NAME2數據" "0" ; Set_back
fi
else
[[ $FILE_NAME2 = thanox ]] && rm -rf "$(find "/data/system" -name "thanos_*" -maxdepth 1 -type d)"
case ${FILE_NAME##*.} in
lz4) pv "$tar_path" | tar --recursive-unlink -I lz4 -xmPpf - ;;
zst) pv "$tar_path" | tar --recursive-unlink -I zstd -xmPpf - ;;
@@ -127,7 +120,10 @@ if [[ $Recovery_mode = true ]]; then
echoRgb "路徑$X不存在" "0"
fi
elif [[ $FILE_NAME2 = data ]]; then
chown -R "1023:1078" "$path/data/$name"
[[ -d $path/data/$name2 ]] && chown -R "1023:1078" "$path/data/$name2"
elif [[ $FILE_NAME2 = thanox ]]; then
restorecon -R "$(find "/data/system" -name "thanos_*" -maxdepth 1 -type d)" >/dev/null 2>&1
echo_log "selinux上下文設置" && echoRgb "警告 thanox配置恢復後務必重啟\n -否則不生效" "0"
fi
fi
done