Skip to content

Instantly share code, notes, and snippets.

@0x07CB
Last active February 1, 2024 16:36
Show Gist options
  • Save 0x07CB/d63587883aa6813acc429fb79190ad79 to your computer and use it in GitHub Desktop.
Save 0x07CB/d63587883aa6813acc429fb79190ad79 to your computer and use it in GitHub Desktop.
clamav-test scripts - # 1
#!/bin/bash
#
#
function test_clamav_(){
TEST_OUT_=$(curl https://secure.eicar.org/eicar.com.txt | clamscan -)
RESULT_=$(echo $TEST_OUT | grep "stdin : Win.Test.EICAR_HDB-1 FOUND" | wc -l)
if [[ "$RESULT_" != "0" ]]; then
return 1
else
return 0
fi
}
if test_clamav_; then
echo "CLAMAV EICAR TESTING: OK" >&2
exit 0
else
echo "CLAMAV EICAR TESTING: ERROR" >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment