mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 11:01:50 +00:00
14 lines
No EOL
341 B
Turtle
14 lines
No EOL
341 B
Turtle
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
_set_ttl() {
|
|
device=$(uci -q get network.$1.name)
|
|
ttl=$(uci -q get network.$1.ttl)
|
|
if [ -n "$ttl" ] && [ -z "$(iptables-save | grep TTL | grep $device)" ]; then
|
|
iptables -w -t mangle -I POSTROUTING -o $device -j TTL --ttl-set $ttl 2>&1 >/dev/null
|
|
fi
|
|
}
|
|
|
|
config_load network
|
|
config_foreach _set_ttl device |