Skip to content

Commit aecc644

Browse files
committed
Fix pf anchors detection
1 parent 8991a8f commit aecc644

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

share/pot/common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ _is_vnet_up()
379379
return 1 # false
380380
elif [ ! -c /dev/pf ]; then
381381
return 1 # false
382-
elif pfctl -s Anchors | grep -q -F '^[ \t]*pot-nat$' ; then
382+
elif ! pfctl -s Anchors | grep -q '^[ \t]*pot-nat$' ; then
383383
return 1 # false
384-
elif pfctl -s Anchors | grep -q -F '^[ \t]*pot-rdr$' ; then
384+
elif ! pfctl -s Anchors | grep -q '^[ \t]*pot-rdr$' ; then
385385
return 1 # false
386386
elif [ -z "$(pfctl -s nat -a pot-nat)" ]; then
387387
return 1 # false

share/pot/vnet-start.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ pot-vnet-start()
7474
# load pf module
7575
kldload -n pf
7676
# check anchors
77-
if pfctl -s Anchors | grep -q -F '^[ \t]*pot-nat$' ||
78-
pfctl -s Anchors | grep -F '^[ \t]*pot-rdr$' ; then
77+
if ! pfctl -s Anchors | grep -q '^[ \t]*pot-nat$' ||
78+
! pfctl -s Anchors | grep -q '^[ \t]*pot-rdr$' ; then
7979
_debug "Pot anchors are missing - load pf.conf"
8080
pfctl -f pf.conf
8181
fi

0 commit comments

Comments
 (0)