Skip to content

Commit c400427

Browse files
committed
Verify the integrity of JDownloader.jar during startup.
1 parent 6a8a6b4 commit c400427

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rootfs/etc/cont-init.d/55-jdownloader2.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if [ -f /config/.fix_jd_install ]; then
3838
rm /config/.fix_jd_install
3939
fi
4040

41+
# Remove JDownloader.jar if it has been corrupted.
42+
if [ -f /config/JDownloader.jar ]; then
43+
if ! unzip -t /config/JDownloader.jar 2>/dev/null; then
44+
echo "JDownloader.jar corrupted, removing."
45+
rm /config/JDownloader.jar
46+
fi
47+
fi
48+
4149
# Set default configuration on new install.
4250
[ -f /config/JDownloader.jar ] || {
4351
cp -v /defaults/JDownloader.jar /config/JDownloader.jar

0 commit comments

Comments
 (0)