I'm looking to grep a numeric value from a tripwire report, and if the value is greater than 0, send an email. The script so far looks like this:
#!/bin/bash
tripwire --check > /tmp/twreport
count=grep 'Total violations found: 0' /tmp/twreport
if [ $count < 1 ]; then
mail -s "[tripwire] Report for `uname -n`" user@example.com < /tmp/twreport
fi
Not sure how to grab the value and set it as a variable or if there's a way to include it in the if statement itself.