- Alternative 1
Code:
if [ ! -z "$result" ] ; then
echo "$check found"
else
echo "$check not found"
fi
- Alternative 2, which is used heavily in the OpenBSD rc scripts
Code:
if [ "X${result}" != "X" ] ; then
echo "$check found"
else
echo "$check not found"
fi
- Alternative 3
Code:
if test grep "$check" "$FILE" >/dev/null 2>&1 ; then
echo "$check found"
else
echo "$check not found"
fi
This third alternative is the one I would use
Re: Resources
Don't forget examples like the startup/boot scripts in FreeBSD and NetBSD. By studying them I learned a lot about shell scripting.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
|