qmodem_ttl: remove ifname option.
This commit is contained in:
parent
dc842c4a16
commit
542e99c468
@ -1,6 +1,6 @@
|
||||
local uci = luci.model.uci.cursor()
|
||||
m = Map("qmodem_ttl", translate("TTL Config"))
|
||||
s = m:section(NamedSection, "global", "global", translate("Global Config"))
|
||||
s = m:section(NamedSection, "main", "main", translate("Global Config"))
|
||||
|
||||
enable = s:option(Flag, "enable", translate("Enable"))
|
||||
enable.default = "0"
|
||||
@ -9,11 +9,5 @@ ttl = s:option(Value, "ttl", translate("TTL"))
|
||||
ttl.default = 64
|
||||
ttl.datatype = "uinteger"
|
||||
|
||||
o = s:option(Value, "ifname", translate("Interface"))
|
||||
uci:foreach("network", "interface", function(s)
|
||||
if s[".name"] ~= "loopback" and s[".name"] ~= "lan" then
|
||||
o:value(s[".name"])
|
||||
end
|
||||
end)
|
||||
|
||||
return m
|
||||
|
@ -1 +1 @@
|
||||
config global 'global'
|
||||
config main 'main'
|
||||
|
@ -8,7 +8,7 @@ USE_PROCD=1
|
||||
start_service()
|
||||
{
|
||||
config_load 'qmodem_ttl'
|
||||
config_get enable 'global' 'enable' '0'
|
||||
config_get enable 'main' 'enable' '0'
|
||||
if [ "$enable" == 0 ]; then
|
||||
return
|
||||
fi
|
||||
@ -17,14 +17,10 @@ start_service()
|
||||
|
||||
set_if_ttl()
|
||||
{
|
||||
config_get ifname 'global' 'ifname'
|
||||
config_get ttl 'global' 'ttl'
|
||||
iface=$(ifstatus $ifname)
|
||||
json_load "$iface"
|
||||
json_get_var device device
|
||||
config_get ttl 'main' 'ttl'
|
||||
IPT="iptables"
|
||||
IPT6="ip6tables"
|
||||
logger -t modem_ttl "Setting TTL for $device to $ttl"
|
||||
logger -t modem_ttl "Ovrewirte TTL from br-lan to $ttl"
|
||||
comment="modem_ttl"
|
||||
touch /etc/firewall.d/qmodem_ttl
|
||||
chmod +x /etc/firewall.d/qmodem_ttl
|
||||
@ -44,10 +40,10 @@ set_if_ttl()
|
||||
if [ -n "$IPT6_POSTROUTING" ]; then
|
||||
ip6tables -t mangle -D POSTROUTING $IPT6_POSTROUTING
|
||||
fi
|
||||
echo "$IPT -t mangle -A PREROUTING -i $device -j TTL --ttl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT -t mangle -A POSTROUTING -o $device -j TTL --ttl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT6 -t mangle -A PREROUTING -i $device -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT6 -t mangle -A POSTROUTING -o $device -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT -t mangle -A PREROUTING -i br-lan -j TTL --ttl-set $ttl -m comment --comment $comment" > /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT -t mangle -A POSTROUTING -o !br-lan -j TTL --ttl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT6 -t mangle -A PREROUTING -i br-lan -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
echo "$IPT6 -t mangle -A POSTROUTING -o !br-lan -j HL --hl-set $ttl -m comment --comment $comment" >> /etc/firewall.d/qmodem_ttl
|
||||
/etc/firewall.d/qmodem_ttl
|
||||
chmod -x /etc/firewall.d/qmodem_ttl
|
||||
[ -d /sys/kernel/debug/ecm/ ] && /etc/init.d/qca-nss-ecm stop # disable nss offload
|
||||
@ -77,8 +73,6 @@ stop_service(){
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "qmodem_ttl"
|
||||
procd_add_reload_trigger "network"
|
||||
#netdev
|
||||
}
|
||||
|
||||
reload_service()
|
||||
|
@ -449,7 +449,6 @@ set_if()
|
||||
ifdown ${interface6_name}
|
||||
ifup ${interface_name}
|
||||
ifup ${interface6_name}
|
||||
/etc/init.d/qmodem_ttl start
|
||||
fi
|
||||
if [ "$firewall_reload_flag" -eq 1 ];then
|
||||
uci commit firewall
|
||||
|
Loading…
x
Reference in New Issue
Block a user