mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Fix indentation
This commit is contained in:
parent
8ce857cdd6
commit
245d1b43c4
1 changed files with 13 additions and 12 deletions
|
@ -148,18 +148,19 @@ restart_omrtracker() {
|
|||
}
|
||||
|
||||
set_lan_ips() {
|
||||
config_get ip4table "$1" ip4table
|
||||
config_get device "$1" device
|
||||
config_get proto "$1" proto
|
||||
if [ "$ip4table" != "wan" ] && [ "$ip4table" != "vpn" ] && [ -n "$ip4table" ] && [ -n "$device" ] && ([ "$proto" = "dhcp" ] || [ "$proto" = "static" ]); then
|
||||
[ -z "$(uci -q get shadowsocks-libev.ss_rules.ifnames | grep $device)" ] && [ -z "$(uci -q get shadowsocks-rust.ss_rules.ifnames | grep $device)" ] && {
|
||||
uci -q add_list shadowsocks-libev.ss_rules.ifnames="$device"
|
||||
uci -q add_list shadowsocks-rust.ss_rules.ifnames="$device"
|
||||
}
|
||||
elif [ -n "$device" ] && [ -n "$(uci -q get shadowsocks-libev.ss_rules.ifnames | grep $device)" ]; then
|
||||
uci -q del_list shadowsocks-libev.ss_rules.ifnames="$device"
|
||||
uci -q del_list shadowsocks-rust.ss_rules.ifnames="$device"
|
||||
fi
|
||||
config_get ip4table "$1" ip4table
|
||||
config_get device "$1" device
|
||||
config_get proto "$1" proto
|
||||
[ -n "$(echo $device | grep -)" ] && uci -q set openmptcprouter.settings.restrict_to_lan="0" && uci commit openmptcprouter
|
||||
if [ "$ip4table" != "wan" ] && [ "$ip4table" != "vpn" ] && [ -n "$ip4table" ] && [ -n "$device" ] && ([ "$proto" = "dhcp" ] || [ "$proto" = "static" ]); then
|
||||
[ -z "$(uci -q get shadowsocks-libev.ss_rules.ifnames | grep $device)" ] && [ -z "$(uci -q get shadowsocks-rust.ss_rules.ifnames | grep $device)" ] && {
|
||||
uci -q add_list shadowsocks-libev.ss_rules.ifnames="$device"
|
||||
uci -q add_list shadowsocks-rust.ss_rules.ifnames="$device"
|
||||
}
|
||||
elif [ -n "$device" ] && [ -n "$(uci -q get shadowsocks-libev.ss_rules.ifnames | grep $device)" ]; then
|
||||
uci -q del_list shadowsocks-libev.ss_rules.ifnames="$device"
|
||||
uci -q del_list shadowsocks-rust.ss_rules.ifnames="$device"
|
||||
fi
|
||||
}
|
||||
config_load network
|
||||
config_foreach restart_omrtracker interface
|
||||
|
|
Loading…
Reference in a new issue