|
|
@@ -60,22 +60,22 @@ banwanin() {
|
|
|
|
|
|
dropwanin() {
|
|
|
while read -r port ; do
|
|
|
- [[ -n "$port" ]] || continue
|
|
|
+ [[ "$port" =~ ^[0-9]{1,}$ ]] || continue
|
|
|
iptables -A WANIN -i ${wan} -m udp -p udp --dport $port -j DROP
|
|
|
done < $CONFD/DROP.udp
|
|
|
while read -r port ; do
|
|
|
- [[ -n "$port" ]] || continue
|
|
|
+ [[ "$port" =~ ^[0-9]{1,}$ ]] || continue
|
|
|
iptables -A WANIN -i ${wan} -m tcp -p tcp --dport $port -j DROP
|
|
|
done < $CONFD/DROP.tcp
|
|
|
}
|
|
|
|
|
|
passwanin() {
|
|
|
while read -r port ; do
|
|
|
- [[ -n "$port" ]] || continue
|
|
|
+ [[ "$port" =~ ^[0-9]{1,}$ ]] || continue
|
|
|
iptables -A WANIN -i ${wan} -m udp -p udp --dport $port -j ACCEPT
|
|
|
done < $CONFD/ACCEPT.udp
|
|
|
while read -r port ; do
|
|
|
- [[ -n "$port" ]] || continue
|
|
|
+ [[ "$port" =~ ^[0-9]{1,}$ ]] || continue
|
|
|
iptables -A WANIN -i ${wan} -m tcp -p tcp --dport $port -j ACCEPT
|
|
|
done < $CONFD/ACCEPT.tcp
|
|
|
}
|