Skip to content

Commit

Permalink
fix malware scan java check once and for all
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7d8 committed Dec 1, 2024
1 parent 6c27aa9 commit d6dcaa9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions java/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ JAVA_MAJOR_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | aw
if [[ "$MALWARE_SCAN" == "1" ]]; then
if [[ ! -f "/MCAntiMalware.jar" ]]; then
echo -e "${LOG_PREFIX} Malware scanning is only available for Java 17 and above, skipping..."
MALWARE_SCAN=0
fi

echo -e "${LOG_PREFIX} Scanning for malware... (This may take a while)"
else
echo -e "${LOG_PREFIX} Scanning for malware... (This may take a while)"

java -jar /MCAntiMalware.jar --scanDirectory . --singleScan true --disableAutoUpdate true
java -jar /MCAntiMalware.jar --scanDirectory . --singleScan true --disableAutoUpdate true

if [ $? -eq 0 ]; then
echo -e "${LOG_PREFIX} Malware scan has passed"
else
echo -e "${LOG_PREFIX} Malware scan has failed"
exit 1
if [ $? -eq 0 ]; then
echo -e "${LOG_PREFIX} Malware scan has passed"
else
echo -e "${LOG_PREFIX} Malware scan has failed"
exit 1
fi
fi
else
echo -e "${LOG_PREFIX} Skipping malware scan..."
Expand Down

0 comments on commit d6dcaa9

Please sign in to comment.