mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Apply glorytun-udp settings
This commit is contained in:
parent
f34ff67f58
commit
d1209f1f6c
1 changed files with 17 additions and 11 deletions
|
@ -11,17 +11,23 @@
|
|||
. /lib/functions/network.sh
|
||||
|
||||
set_default() {
|
||||
local localip
|
||||
local remoteip
|
||||
local config="$1"
|
||||
local iface
|
||||
config_get enable "$config" enable
|
||||
config_get iface "$config" dev
|
||||
[ "$iface" = "$DEVICE" ] && [ "$enable" = "1" ] && {
|
||||
config_get localip "$config" localip
|
||||
config_get remoteip "$config" remoteip
|
||||
[ "$remoteip" != "" ] && [ "$localip" != "" ] && ifconfig $DEVICE $localip pointopoint $remoteip up
|
||||
}
|
||||
local localip
|
||||
local remoteip
|
||||
local config="$1"
|
||||
local iface
|
||||
config_get enable "$config" enable
|
||||
config_get iface "$config" dev
|
||||
[ "$iface" = "$DEVICE" ] && [ "$enable" = "1" ] && {
|
||||
config_get localip "$config" localip
|
||||
config_get remoteip "$config" remoteip
|
||||
config_get kxtimeout "$config" kxtimeout "7d"
|
||||
config_get timetolerance "$config" timetolerance "10m"
|
||||
config_get keepalive "$config" keepalive "25s"
|
||||
[ "$remoteip" != "" ] && [ "$localip" != "" ] && ifconfig $DEVICE $localip pointopoint $remoteip up
|
||||
while [ -z "$(glorytun-udp list | grep $iface)" ]; do
|
||||
glorytun-udp set dev $iface kxtimeout $kxtimeout timetolerance $timetolerance keepalive $keepalive
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
config_load glorytun-udp
|
||||
|
|
Loading…
Reference in a new issue