From a5473f86f3d039637757ff2573e45b7e08f812a6 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 15 Dec 2020 15:43:42 +0100 Subject: [PATCH] Apply glorytun-udp settings --- .../root/etc/hotplug.d/iface/30-glorytun-udp | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp b/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp index b942fd60c..a1ac50669 100644 --- a/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp +++ b/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp @@ -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