-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
defs
36 lines (29 loc) · 748 Bytes
/
defs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
HEAD='<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link rel="stylesheet" href="style.css">
<title>Openvpn client management</title>
</head>
<body>'
END='</body></html>'
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
parse_get_arg()
{
while IFS='=' read -r -d '&' var val; do
var=$(urldecode "$var")
[ "$var" = "$1" ] && echo $(urldecode "$val") && return 0
done<<<"${QUERY_STRING}&"
return 1
}
export -f parse_get_arg
parse_post_arg()
{
while IFS='=' read -r -d '&' var val; do
var=$(urldecode "$var")
[ "$var" = "$1" ] && echo $(urldecode "$val") && return 0
done<<<"${POST_STRING}&"
return 1
}
export -f parse_post_arg
. /etc/openvpn/http/easyrsa.env