Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
S1OVS
openvpn-server
Commits
b5c6517d
Commit
b5c6517d
authored
Mar 22, 2016
by
Matthew Smith
Browse files
Fixed html layout
parent
1112fcdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/status
View file @
b5c6517d
...
...
@@ -85,11 +85,14 @@ function Create_Html_Status() {
fi
server_conf
=
""
#TODO: Can we do some fancy read each conf an list keys for that conf. maybe not.
server_conf
=
"
$OVPN_ORGNICK
-server.conf"
table_body
=
$(
Open_Table_Section
)
#TODO: Can we get this from the server conf?
openvpn_index
=
"/var/lib/openvpn-server/openssl/index.txt"
for
vpn_name
in
`
grep
^V
$openvpn_index
|
grep
emailAddress
|
sed
-e
"s/
\/
emailAddress//g"
|
awk
-F
"="
{
'print $5'
}
`
;
do
for
vpn_name
in
`
grep
^V
$openvpn_index
|
grep
CN |
grep
-v
"OpenVPN server on"
|
sed
-e
"s/
\/
emailAddress//g"
|
awk
-F
"="
{
'print $5'
}
`
;
do
## Details of current status
#tail /var/lib/openvpn-server/openvpn/status.log | grep ltu-kit01 | tail -n1 | awk -F"," {'print $2 " " $1 " " $3 " " $4'} | sed -e 's/:[0-9]\{3,5\}//g'
...
...
@@ -113,15 +116,15 @@ function Create_Html_Status() {
if
[
"
$connection_type
"
==
"connect"
]
;
then
row_class
=
"
$connection_type
connected"
vpn_ip
=
$this_ip
conne
ne
cted_since
=
$(
echo
$connected_user
|
cut
-f7
-d
","
)
connected_since
=
$(
echo
$connected_user
|
cut
-f7
-d
","
)
else
row_class
=
"
$connection_type
"
fi
elif
grep
-q
$vpn_name
"
$status_log
"
;
then
# non triggering connected user
row_class
=
"connected"
vpn_ip
=
$(
echo
$connected_user
|
cut
-f
2
-d
","
)
conne
ne
cted_since
=
$(
echo
$connected_user
|
cut
-f7
-d
","
)
vpn_ip
=
$(
echo
$connected_user
|
cut
-f
4
-d
","
)
connected_since
=
$(
echo
$connected_user
|
cut
-f7
-d
","
)
else
# not connected
echo
-n
""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment