pf: Friendly error message for status if pf.ko is not loaded
Check if pf.ko is loaded (i.e. /dev/pf exists) before trying to use it. This means that '/etc/rc.d/pf status' will no longer return 'pfctl: /dev/pf: No such file or directory' but 'pf.ko is not loaded'. PR: 205671 Submitted by: Johannes Jost Meixner <xmj@FreeBSD.org>
This commit is contained in:
parent
938e6bb267
commit
2f396d3cc3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297315
@ -66,7 +66,11 @@ pf_resync()
|
|||||||
|
|
||||||
pf_status()
|
pf_status()
|
||||||
{
|
{
|
||||||
|
if ! [ -c /dev/pf ] ; then
|
||||||
|
echo "pf.ko is not loaded"
|
||||||
|
else
|
||||||
$pf_program -s info
|
$pf_program -s info
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_rc_command "$1"
|
run_rc_command "$1"
|
||||||
|
Loading…
Reference in New Issue
Block a user