Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 13th November 2010
marbi marbi is offline
New User
Join Date: Nov 2010
Posts: 1
Default Bash and pfctl = problem


I would like to write a script that is able to check if file pf.conf has any errors:

pfctl -n -f pf.conf

- if configuration file is OK there will be no response
- if configuration file in not OK, then some error may come up

syntax error
this one is OK, but neither way Bash can't see it, apart from that, I can't neither take it over nor save it to the file

and simple intruction:
var1=`/sbin/pfctl -n -f /etc/pf.test.conf`
if [ -z "$var1" ]; then
echo OK
echo not OK

But each time the replay is OK, no matter if the configuration file has some errors or doesn't have any.
Therefore, does anybody have any idea how to check if the configuration file is OK and after that, how to transfer the result to Bash script?

Thank you.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pfctl anchors manipulation clarification on 4.7 sgeorge OpenBSD Security 0 2nd July 2010 05:16 AM
flush states pfctl joostvgh OpenBSD Security 3 27th January 2010 06:50 PM
Changing shell to bash rex FreeBSD General 13 29th August 2008 03:20 AM
Is bash included in OpenBSD? bsdnewbie999 OpenBSD General 21 2nd August 2008 02:57 AM
pfctl -s info counters don't change audio FreeBSD Security 2 16th July 2008 11:01 PM

All times are GMT. The time now is 01:01 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick