Running ubuntu 8.04
I built this off of the tripwire daily cron script. I'm trying to check the number of violations.
There's a problem when $tripResult is instantiated with the tripwire report- it doesn't have any newline characters.
This causes grep to not get the line with the number of violations, it just gets the entire report.
#!/bin/sh -e
tripwire=/usr/sbin/tripwire
[ -x $tripwire ] || exit 0
umask 027
tripResult=$($tripwire --check --quiet)
tripViolations=$(echo $tripResult | grep "Total violations found" | awk '{print $4}')
exit 0