mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add OpenVPN with MPTCP upstream support
This commit is contained in:
parent
04e1c1cd1b
commit
363f07142f
19 changed files with 2026 additions and 0 deletions
16
openvpn/files/lib/functions/openvpn.sh
Normal file
16
openvpn/files/lib/functions/openvpn.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
get_openvpn_option() {
|
||||
local config="$1"
|
||||
local variable="$2"
|
||||
local option="$3"
|
||||
|
||||
local value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+'"'([^']+)'"'[ \t]*$/\1/p' "$config" | tail -n1)"
|
||||
[ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+"(([^"\\]|\\.)+)"[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')"
|
||||
[ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+(([^ \t\\]|\\.)+)[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')"
|
||||
[ -n "$value" ] || return 1
|
||||
|
||||
export -n "$variable=$value"
|
||||
return 0
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue