Skip to content

Commit

Permalink
Make scan log filename a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dav3r committed Mar 14, 2023
1 parent 5f20764 commit d7b4806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extras/clamav_log_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ logfile="./clamav-$today.log"
exec > >(tee -ai "$logfile")
exec 2> >(tee -ai "$logfile" >&2)

clamav_scan_log="/var/log/clamav/lastscan.log"

instances=("$@")

for instance_id in "${instances[@]}"; do
# tail --lines=12: Output last 12 lines of ClamAV scan log, which includes
# the summary of the most-recent scan results.
aws ssm start-session --target="$instance_id" \
--document=AWS-StartInteractiveCommand \
--parameters="command='hostname; tail --lines=12 /var/log/clamav/lastscan.log'"
--parameters command="hostname; tail --lines=12 $clamav_scan_log"
done

0 comments on commit d7b4806

Please sign in to comment.