Skip to content

Commit

Permalink
fixes #134,#132 - removes Core.jar in case of unatomic update process
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Dec 20, 2024
1 parent c19b155 commit 3fc0d48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@ fi

# Copy if no JDownloader exists
if [ ! -f /opt/JDownloader/app/JDownloader.jar ]; then
rm /opt/JDownloader/app/Core.jar
cp /opt/JDownloader/JDownloader.jar /opt/JDownloader/app/
fi

# Check JDownloader.jar integrity and removes it in case it's not
jar tvf /opt/JDownloader/app/JDownloader.jar > /dev/null 2>&1
if [ $? -ne 0 ]; then
rm /opt/JDownloader/app/JDownloader.jar
rm /opt/JDownloader/app/Core.jar
fi

# Check if JDownloader.jar exists, or if there is an interrupted update
if [ ! -f /opt/JDownloader/app/JDownloader.jar ] && [ -f /opt/JDownloader/app/tmp/update/self/JDU/JDownloader.jar ]; then
rm /opt/JDownloader/app/Core.jar
cp /opt/JDownloader/app/tmp/update/self/JDU/JDownloader.jar /opt/JDownloader/app/
fi

Expand Down

0 comments on commit 3fc0d48

Please sign in to comment.