From b645e0f2059d261b09b1d17cfbdebe488d75c1f1 Mon Sep 17 00:00:00 2001 From: ChuckPa Date: Sat, 12 Nov 2022 01:17:53 -0500 Subject: [PATCH] Viewstate import - Improve error checking and recovery --- DBRepair.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/DBRepair.sh b/DBRepair.sh index d58f867..f5f43f2 100755 --- a/DBRepair.sh +++ b/DBRepair.sh @@ -1112,17 +1112,16 @@ do # Import viewstates into working copy Output "Importing Viewstate data" - "$PLEX_SQLITE" $CPPL.db < "$TMPDIR/Viewstate.sql-$TimeStamp" - Result=$? + "$PLEX_SQLITE" $CPPL.db < "$TMPDIR/Viewstate.sql-$TimeStamp 2> /dev/null" # Make certain the resultant DB is OK Output "Checking database following import" - if ! CheckDB $CPPL.db ; then + if ! CheckDB $CPPL.db ; then Output "Error $Result during import. Import corrupted database." Output " Undoing viewstate import." - RestoreSaved "$LastTimestamp" + cp -p "$TMPDIR/Viewstate.db-$TimeStamp" $CPPL.db WriteLog "Import - Import: $Input - FAIL" continue fi