#!/usr/bin/env bash
set -Eeuo pipefail
UPLOAD_ROOT="/var/lib/rustypaste/uploads"
exec inotifywait --monitor --recursive --quiet --format '%w%f' --event close_write,moved_to "$UPLOAD_ROOT" |
while IFS= read -r FILE; do /usr/local/sbin/rustypaste-clamav-scan "$FILE" & done
