Quote:
Originally Posted by marbi
var1=`/sbin/pfctl -n -f /etc/pf.test.conf`
if [ -z "$var1" ]; then
echo OK
else
echo not OK
fi
|
The "trick" is to use the $? variable to capture the return code from the command:
/sbin/pfctl -n -f /etc/pf.conf
rc=$?
if [ $rc -eq 0 ]; then
echo "OK"
else
echo "not OK"
fi