1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 11:01:50 +00:00
openmptcprouter-feeds/openmptcprouter/files/etc/firewall.ttl
Ycarus (Yannick Chabanois) 806bc40980 Add ttl setting support
2021-08-30 21:35:27 +02:00

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