1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 19:11:51 +00:00
openmptcprouter-feeds/openmptcprouter/files/etc/uci-defaults/1980-omr-firewall
2018-05-31 15:44:40 +02:00

40 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
if [ "$(uci -q show firewall | grep Allow-All-Ping)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add firewall rule
set firewall.@rule[-1].enabled='1'
set firewall.@rule[-1].target='ACCEPT'
set firewall.@rule[-1].name='Allow-All-Ping'
set firewall.@rule[-1].proto='icmp'
set firewall.@rule[-1].dest='*'
set firewall.@rule[-1].src='*'
set firewall.@rule[-1].icmp_type='echo-request'
commit firewall
EOF
fi
if [ "$(uci -q show firewall | grep Allow-VPN-ICMP)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add firewall rule
set firewall.@rule[-1].enabled='1'
set firewall.@rule[-1].target='ACCEPT'
set firewall.@rule[-1].name='Allow-VPN-ICMP'
set firewall.@rule[-1].proto='icmp'
set firewall.@rule[-1].src='vpn'
commit firewall
EOF
fi
if [ "$(uci -q show firewall | grep Allow-Lan-to-Wan)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add firewall rule
set firewall.@rule[-1].enabled='1'
set firewall.@rule[-1].target='ACCEPT'
set firewall.@rule[-1].name='Allow-Lan-to-Wan'
set firewall.@rule[-1].dest='wan'
set firewall.@rule[-1].src='lan'
commit firewall
EOF
fi
rm -f /tmp/luci-indexcache
exit 0