Skip to content

Commit

Permalink
Small fixes for CLAMD Health Check
Browse files Browse the repository at this point in the history
  • Loading branch information
DerLinkman committed Aug 4, 2023
1 parent c948a6c commit 384307b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/Dockerfiles/clamd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ COPY --from=builder "/clamav" "/"

# init
COPY clamd.sh /clamd.sh
COPY clamdcheck.sh /usr/local/bin/
RUN chmod +x /sbin/tini

# healthcheck
Expand Down
14 changes: 14 additions & 0 deletions data/Dockerfiles/clamd/clamdcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -eu

if [ "${CLAMAV_NO_CLAMD:-}" != "false" ]; then
if [ "$(echo "PING" | nc localhost 3310)" != "PONG" ]; then
echo "ERROR: Unable to contact server"
exit 1
fi

echo "Clamd is up"
fi

exit 0

0 comments on commit 384307b

Please sign in to comment.