mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Fix firewall setting not being applied. return incase the interap socket fails. Clean up in failure conditions. Signed-off-by: Chaitanya Godavarthi <chaitanya.kiran@netexperience.com>
36 lines
847 B
Bash
36 lines
847 B
Bash
#!/bin/sh /etc/rc.common
|
|
|
|
START=12
|
|
STOP=12
|
|
|
|
start() {
|
|
apc=`cat /etc/config/firewall | grep Allow-APC`
|
|
ucc=`cat /etc/config/firewall | grep Allow-UCC`
|
|
|
|
if [ -z "$apc" ]; then
|
|
uci add firewall rule
|
|
uci set firewall.@rule[-1].name='Allow-APC'
|
|
uci set firewall.@rule[-1].src='wan'
|
|
uci set firewall.@rule[-1].proto='udp'
|
|
uci set firewall.@rule[-1].dst_port='50010'
|
|
uci set firewall.@rule[-1].target='ACCEPT'
|
|
uci set firewall.@rule[-1].family='ipv4'
|
|
uci commit firewall
|
|
fi
|
|
|
|
if [ -z "$ucc" ]; then
|
|
uci add firewall rule
|
|
uci set firewall.@rule[-1].name='Allow-UCC'
|
|
uci set firewall.@rule[-1].src='wan'
|
|
uci set firewall.@rule[-1].proto='udp'
|
|
uci set firewall.@rule[-1].dst_port='50000'
|
|
uci set firewall.@rule[-1].target='ACCEPT'
|
|
uci set firewall.@rule[-1].family='ipv4'
|
|
uci commit firewall
|
|
fi
|
|
}
|
|
|
|
stop() {
|
|
echo stop
|
|
}
|