mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Apply glorytun-udp settings
This commit is contained in:
		
							parent
							
								
									409bb6586d
								
							
						
					
					
						commit
						a5473f86f3
					
				
					 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue