Skip to content

Commit

Permalink
more compatible
Browse files Browse the repository at this point in the history
Signed-off-by: peter-tank <30540412+peter-tank@users.noreply.github.com>
  • Loading branch information
peter-tank committed Jan 9, 2020
1 parent 038677f commit dc2a42a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions luasrc/model/cbi/fullconenat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ o.write = function (self, sec, val)
zn:set("masq", val == "disable" and 1 or 0)
if fw3_buildin then
def:set("fullcone", val == "all" and 1 or 0)
zn:set("fullcone", val == "all" and 1 or 0)
end
fwm.commit()
return self.map:set(sec, self.option, val)
Expand Down
2 changes: 1 addition & 1 deletion po/zh-cn/fullconenat.po
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
msgid "fullconenat"
msgstr "Fullcone NAT"
msgstr "全端口映射"

msgid "FULLCONENAT"
msgstr "Fullcone NAT"
Expand Down
6 changes: 5 additions & 1 deletion root/etc/init.d/fullconenat
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ start(){
else
masq=1
fi
[ $fw3_buildin -eq 0 ] && uci set firewall.@defaults[0].fullcone=$fullcone
[ $fw3_buildin -eq 0 ] && {
uci set firewall.@defaults[0].fullcone=$fullcone
uci set firewall.@zone[1].fullcone=$fullcone
}
uci set firewall.@zone[1].masq=$masq
uci commit firewall
/etc/init.d/firewall restart
Expand All @@ -57,6 +60,7 @@ stop(){
sed -i '/FULLCONENAT/d' /etc/firewall.user
[ $re -eq 0 ] && {
uci set firewall.@defaults[0].fullcone=0
uci set firewall.@zone[1].fullcone=0
uci set firewall.@zone[1].masq=1
uci commit firewall
/etc/init.d/firewall restart
Expand Down

0 comments on commit dc2a42a

Please sign in to comment.