Commit a025fad7 authored by thomas.forbriger's avatar thomas.forbriger

BFO2LSDF [TASK]: wait for openvpn

Let openvpn establish the connection before testing for an existing
connection.
parent 47aaf0a0
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment