diff options
author | pjd <pjd@FreeBSD.org> | 2005-09-24 15:57:17 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-09-24 15:57:17 +0000 |
commit | 264e350e934b944f88622c1cd9817a70f21572e1 (patch) | |
tree | b95700074e69432e5614ffdcfd868050299bf97b /etc | |
parent | 479d185b1e0a377b3a32108f340adf8a0ee581af (diff) | |
download | FreeBSD-src-264e350e934b944f88622c1cd9817a70f21572e1.zip FreeBSD-src-264e350e934b944f88622c1cd9817a70f21572e1.tar.gz |
Simplify the code by making use of 'kldstat -q -m <mod>'.
No objections from: mlaier
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.d/pf | 9 | ||||
-rw-r--r-- | etc/rc.d/pflog | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/etc/rc.d/pf b/etc/rc.d/pf index 3b9ae93..3082796 100644 --- a/etc/rc.d/pf +++ b/etc/rc.d/pf @@ -30,8 +30,8 @@ extra_commands="check reload resync status" pf_prestart() { # load pf kernel module if needed - if ! kldstat -v | grep -q pf\$; then - if kldload pf; then + if ! kldstat -q -m pf ; then + if kldload pf ; then info 'pf module loaded.' else err 1 'pf module failed to load.' @@ -84,10 +84,7 @@ pf_reload() pf_resync() { # Don't resync if pf is not loaded - if ! kldstat -v | grep -q pf\$ ; then - return - fi - ${pf_program:-/sbin/pfctl} -f "${pf_rules}" ${pf_flags} + kldstat -q -m pf && ${pf_program:-/sbin/pfctl} -f "${pf_rules}" ${pf_flags} } pf_status() diff --git a/etc/rc.d/pflog b/etc/rc.d/pflog index 4adbdfc..859bde7 100644 --- a/etc/rc.d/pflog +++ b/etc/rc.d/pflog @@ -26,7 +26,7 @@ extra_commands="resync status" pflog_prestart() { # load pflog kernel module if needed - if ! kldstat -v | grep -q pflog\$; then + if ! kldstat -q -m pflog; then if kldload pf; then info 'pflog module loaded.' else |