1
0
Fork 0
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:
Ycarus (Yannick Chabanois) 2023-08-17 11:31:53 +02:00
parent 04e1c1cd1b
commit 363f07142f
19 changed files with 2026 additions and 0 deletions

View 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
}