diff --git a/files/ua2f.config b/files/ua2f.config index 9dbc750e..db1677dd 100644 --- a/files/ua2f.config +++ b/files/ua2f.config @@ -1,6 +1,6 @@ config ua2f 'enabled' - option enabled '1' + option enabled '0' config ua2f 'firewall' option handle_fw '1' diff --git a/files/ua2f.init b/files/ua2f.init index 68c1d0a7..c5a89d3c 100755 --- a/files/ua2f.init +++ b/files/ua2f.init @@ -32,7 +32,7 @@ start_service() { procd_close_instance local wan - wan=$(ubus call network.interface.wan status | grep nexthop | grep -oE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)") + wan=$(route -n | grep UG | awk '{print $2}') [ "$handle_fw" -eq "1" ] && { ipset create nohttp hash:ip,port hashsize 16384 timeout 300 @@ -44,7 +44,7 @@ start_service() { [[ $wan =~ ^10. ]] && { iptables -t mangle -D ua2f 1 } - [[ $wan =~ ^172.((1[6-9])|(2[0-9])|(3[0-1])) ]] && { + ( echo "$wan" | grep -Eq "^172\.((1[6-9])|(2[0-9])|(3[0-1]))\." ) && { iptables -t mangle -D ua2f 2 } [[ $wan =~ ^192.168 ]] && {