diff options
author | Kristof Provost <kp@FreeBSD.org> | 2018-06-06 19:36:37 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2018-06-06 19:36:37 +0000 |
commit | fa1d4439f9c76aac6778e843f06bee609fa5cd17 (patch) | |
tree | 14195f93ffa9c7b9903338677a0f01b2a6fa21f8 /etc | |
parent | ff34bbe9c237f0d16a8535b718f0578e2fb7ad87 (diff) | |
download | src-fa1d4439f9c76aac6778e843f06bee609fa5cd17.tar.gz src-fa1d4439f9c76aac6778e843f06bee609fa5cd17.zip |
pf: Return non-zero from 'status' if pf is not enabled
In the pf rc.d script the output of `/etc/rc.d/pf status` or `/etc/rc.d/pf
onestatus` always provided an exit status of zero. This made it fiddly to
programmatically determine if pf was running or not.
Return a non-zero status if the pf module is not loaded, extend pfctl to have
an option to return an error status if pf is not enabled.
PR: 228632
Submitted by: James Park-Watt <jimmypw AT gmail.com>
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=334726
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.d/pf | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/etc/rc.d/pf b/etc/rc.d/pf index 5bd67e600fa4..57de19218fcf 100755 --- a/etc/rc.d/pf +++ b/etc/rc.d/pf @@ -66,8 +66,10 @@ pf_status() { if ! [ -c /dev/pf ] ; then echo "pf.ko is not loaded" + return 1 else $pf_program -s info + $pf_program -s Running >/dev/null fi } |