[Soekris] self auditing netbsd email script

Philip subs at christiantena.net
Fri Apr 15 15:43:32 UTC 2011


I have put this little script in an audit.sh file, and then set a
crontab to run the file every 24 hrs.
the contents of the script is

#!/bin/sh
/usr/pkg/sbin/download-vulnerability-list
/usr/pkg/sbin/audit-packages > /root/auditpackages.txt
if [ -s /root/auditpackages.txt ]; then (echo "Subject: Audit Packages Output";cat /root/auditpackages.txt)|/usr/sbin/sendmail -r hostname me at mydomain.net
fi

it relies on the fact that if there are no vulnerabilities then the output of audit-packages is nothing, so it only sends an email if there is a problem.

Anyone know how to do a similar thing with freebsd ?

regards, Philip




More information about the Soekris-tech mailing list