From 3536ae94788efca1422313a99f2a7fa2eab8b613 Mon Sep 17 00:00:00 2001 From: LukeeGD Date: Wed, 1 Apr 2020 11:17:19 +0800 Subject: [PATCH] Exit --- restore.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/restore.sh b/restore.sh index 0d0c2e2..2b670e1 100755 --- a/restore.sh +++ b/restore.sh @@ -34,8 +34,7 @@ function Log { function Error { echo "[Error] $1" | tee -a restore_log.txt - if [[ ! -z $2 ]]; then - echo $2 | tee -a restore_log.txt + [[ ! -z $2 ]] && echo $2 | tee -a restore_log.txt exit } @@ -141,10 +140,11 @@ function Action { if [[ $Mode == 'Downgrade' ]]; then Downgrade elif [[ $Mode == 'SaveOTABlobs' ]]; then - SaveOTABlobs; exit + SaveOTABlobs elif [[ $Mode == 'kDFU' ]]; then - kDFU; exit + kDFU fi + exit } function SaveOTABlobs { @@ -154,7 +154,6 @@ function SaveOTABlobs { SHSH=$(ls ${UniqueChipID}_${ProductType}_${DowngradeVer}-*.shsh2) if [ ! -e "$SHSH" ]; then Error "Saving $DowngradeVer blobs failed. Please run the script again" "It is also possible that $DowngradeVer for $ProductType is no longer signed" - exit fi mkdir -p saved/shsh 2>/dev/null cp "$SHSH" saved/shsh @@ -309,7 +308,6 @@ function Downgrade { Log "Stopping local server..." ps aux | awk '/python3/ {print "sudo kill -9 "$2" 2>/dev/null"}' | bash Log "Downgrade script done!" - exit } function InstallDependencies {