File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -85,17 +85,18 @@ pot-init()
85
85
# service syslogd restart
86
86
87
87
# Add pot anchors if needed
88
- if [ -r /etc/pf.conf ] && [ " $( grep -c ' ^nat-anchor pot-nat$' /etc/pf.conf ) " -eq 1 ] && [ " $( grep -c ' ^rdr-anchor "pot-rdr/\*"$' /etc/pf.conf ) " -eq 1 ] ; then
88
+ pf_file=" $( sysrc -n pf_rules) "
89
+ if [ -r " $pf_file " ] && [ " $( grep -c ' ^nat-anchor pot-nat$' " $pf_file " ) " -eq 1 ] && [ " $( grep -c ' ^rdr-anchor "pot-rdr/\*"$' " $pf_file " ) " -eq 1 ] ; then
89
90
_debug " pf alredy properly configured"
90
91
else
91
- if [ -w /etc/pf.conf ]; then
92
+ if [ -w " $pf_file " ]; then
92
93
# delete incomplete/broken ancory entries - just in case
93
- sed -i ' ' ' /^nat-anchor pot-nat$/d' /etc/pf.conf
94
- sed -i ' ' ' /^rdr-anchor "pot-rdr\/\*"$/d' /etc/pf.conf
94
+ sed -i ' ' ' /^nat-anchor pot-nat$/d' " $pf_file "
95
+ sed -i ' ' ' /^rdr-anchor "pot-rdr\/\*"$/d' " $pf_file "
95
96
else
96
- touch /etc/pf.conf
97
+ touch " $pf_file "
97
98
fi
98
- printf " %s\n" 0a " nat-anchor pot-nat" " rdr-anchor \" pot-rdr/*\" " . x | ex /etc/pf.conf
99
+ printf " %s\n" 0a " nat-anchor pot-nat" " rdr-anchor \" pot-rdr/*\" " . x | ex " $pf_file "
99
100
fi
100
101
}
101
102
Original file line number Diff line number Diff line change @@ -73,11 +73,12 @@ pot-vnet-start()
73
73
74
74
# load pf module
75
75
kldload -n pf
76
+ pf_file=" $( sysrc -n pf_rules) "
76
77
# check anchors
77
78
if ! pfctl -s Anchors | grep -q ' ^[ \t]*pot-nat$' ||
78
79
! pfctl -s Anchors | grep -q ' ^[ \t]*pot-rdr$' ; then
79
- _debug " Pot anchors are missing - load pf.conf "
80
- pfctl -f /etc/pf.conf
80
+ _debug " Pot anchors are missing - load $pf_file "
81
+ pfctl -f " $pf_file "
81
82
fi
82
83
_nat_rules=" /tmp/pot_pf_nat_rules"
83
84
if [ -w " $_nat_rules " ]; then
You can’t perform that action at this time.
0 commit comments