bug fix
This commit is contained in:
20
tools/script/delete_backup
Normal file
20
tools/script/delete_backup
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
MODDIR="${0%/*}"
|
||||||
|
tools_path="$MODDIR/tools"
|
||||||
|
bin_path="$tools_path/bin"
|
||||||
|
script_path="$tools_path/script"
|
||||||
|
[[ ! -d $tools_path ]] && echo "$tools_path目錄遺失" && exit 1
|
||||||
|
[[ ! -d $script_path ]] && echo "$script_path目錄遺失" && exit 1
|
||||||
|
. "$bin_path/bin.sh"
|
||||||
|
find "$MODDIR" -maxdepth 2 -type d | sort | while read; do
|
||||||
|
if [[ -f $REPLY/app_details ]]; then
|
||||||
|
unset PackageName
|
||||||
|
. "$REPLY/app_details"
|
||||||
|
if [[ $PackageName != "" && $(pm path "$PackageName" | cut -f2 -d ':') = "" ]]; then
|
||||||
|
echoRgb "${REPLY##*/}不存在系統,刪除備份"
|
||||||
|
rm -rf "$REPLY"
|
||||||
|
if [[ ${REPLY%/*}/應用列表.txt ]]; then
|
||||||
|
cat "${REPLY%/*}/應用列表.txt" | sed -e "s/${REPLY##*/} $PackageName//g ; /^$/d" | sort >"${REPLY%/*}/應用列表.tmp" && mv "${REPLY%/*}/應用列表.tmp" "${REPLY%/*}/應用列表.txt"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -19,7 +19,7 @@ txt="$MODDIR/應用列表.txt"
|
|||||||
[[ ! -f $txt ]] && echoRgb "請執行\"掃描資料夾名.sh\"獲取應用列表再來恢復" "0" && exit 2
|
[[ ! -f $txt ]] && echoRgb "請執行\"掃描資料夾名.sh\"獲取應用列表再來恢復" "0" && exit 2
|
||||||
r="$(cat "$txt" | grep -v "#" | sed -e '/^$/d' | sed -n '$=')"
|
r="$(cat "$txt" | grep -v "#" | sed -e '/^$/d' | sed -n '$=')"
|
||||||
[[ $r = "" ]] && echoRgb "應用列表.txt包名為空或是被注釋了" "0" && exit 1
|
[[ $r = "" ]] && echoRgb "應用列表.txt包名為空或是被注釋了" "0" && exit 1
|
||||||
[[ $(restorecon --help 2>/dev/null) = "" ]] && echoRgb "restorecon命令不存在" "0" && exit 1
|
[[ $(which restorecon) = "" ]] && echoRgb "restorecon命令不存在" "0" && exit 1
|
||||||
#顯示執行結果
|
#顯示執行結果
|
||||||
Release_data() {
|
Release_data() {
|
||||||
tar_path="$1"
|
tar_path="$1"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ isBoolean "$Recovery_mode" && Recovery_mode="$nsx"
|
|||||||
path="/data/media/0/Android"
|
path="/data/media/0/Android"
|
||||||
path2="/data/data"
|
path2="/data/data"
|
||||||
[[ ! -d $path2 ]] && echoRgb "設備不存在user目錄" "0" && exit 1
|
[[ ! -d $path2 ]] && echoRgb "設備不存在user目錄" "0" && exit 1
|
||||||
[[ $(restorecon --help 2>/dev/null) = "" ]] && echoRgb "restorecon命令不存在" "0" && exit 1
|
[[ $(which restorecon) = "" ]] && echoRgb "restorecon命令不存在" "0" && exit 1
|
||||||
#記錄開始時間
|
#記錄開始時間
|
||||||
starttime1="$(date -u "+%s")"
|
starttime1="$(date -u "+%s")"
|
||||||
{
|
{
|
||||||
|
|||||||
1
備份應用.sh
1
備份應用.sh
@@ -85,6 +85,7 @@ fi
|
|||||||
[[ ! -d $Backup/tools ]] && cp -r "$tools_path" "$Backup" && rm -rf "$Backup/tools/bin/zip" "$Backup/tools/script"
|
[[ ! -d $Backup/tools ]] && cp -r "$tools_path" "$Backup" && rm -rf "$Backup/tools/bin/zip" "$Backup/tools/script"
|
||||||
[[ ! -f $Backup/還原備份.sh ]] && cp -r "$script_path/restore" "$Backup/還原備份.sh"
|
[[ ! -f $Backup/還原備份.sh ]] && cp -r "$script_path/restore" "$Backup/還原備份.sh"
|
||||||
[[ ! -f $Backup/掃描資料夾名.sh ]] && cp -r "$script_path/Get_DirName" "$Backup/掃描資料夾名.sh"
|
[[ ! -f $Backup/掃描資料夾名.sh ]] && cp -r "$script_path/Get_DirName" "$Backup/掃描資料夾名.sh"
|
||||||
|
[[ ! -f $MODDIR/刪除已卸載備份.sh ]] && cp -r "$script_path/delete_backup" "$MODDIR/刪除已卸載備份.sh"
|
||||||
filesize="$(du -ks "$Backup" | awk '{print $1}')"
|
filesize="$(du -ks "$Backup" | awk '{print $1}')"
|
||||||
#調用二進制
|
#調用二進制
|
||||||
Quantity=0
|
Quantity=0
|
||||||
|
|||||||
Reference in New Issue
Block a user