Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
csback
Commits
a025fad7
Commit
a025fad7
authored
Sep 02, 2016
by
thomas.forbriger
Browse files
BFO2LSDF [TASK]: wait for openvpn
Let openvpn establish the connection before testing for an existing connection.
parent
47aaf0a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
BFO2LSDF.sh
View file @
a025fad7
...
...
@@ -99,19 +99,20 @@ do
established using IP
${
tunIPs
}
."
else
# start openvpn (requires appropriate system configuration)
sudo
/usr/sbin/openvpn /etc/openvpn/scc.ovpn.bromo
>
/dev/null 2>&1
/usr/bin/
sudo /usr/sbin/openvpn /etc/openvpn/scc.ovpn.bromo
>
/dev/null 2>&1
if
[
$?
-ne
0
]
then
${
LOGGER
}
-i
-p
user.err
"
${
LOGERROR
}
Could not establish VPN
\
connection."
exit
2
else
/usr/bin/sleep 10
${
IP
}
addr show
${
TUN_INTERFACE
}
>
/dev/null 2>&1
if
[
$?
-eq
0
]
then
tunIPs
=
$(
${
IP
}
addr show
${
TUN_INTERFACE
}
|
${
GREP
}
-e
"inet"
|
\
awk
'{print $2}'
)
${
LOGGER
}
-i
-p
user.info
"
${
LOGINFO
}
VPN connection
already had been
\
${
LOGGER
}
-i
-p
user.info
"
${
LOGINFO
}
VPN connection
is
\
established using IP
${
tunIPs
}
."
else
${
LOGGER
}
-i
-p
user.err
"
${
LOGERROR
}
Could not establish VPN
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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