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

BFO2LSDF [TASK]: wait for openvpn

Let openvpn establish the connection before testing for an existing
connection.
parent 47aaf0a0
...@@ -99,19 +99,20 @@ do ...@@ -99,19 +99,20 @@ do
established using IP ${tunIPs}." established using IP ${tunIPs}."
else else
# start openvpn (requires appropriate system configuration) # 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 ] if [ $? -ne 0 ]
then then
${LOGGER} -i -p user.err "${LOGERROR} Could not establish VPN \ ${LOGGER} -i -p user.err "${LOGERROR} Could not establish VPN \
connection." connection."
exit 2 exit 2
else else
/usr/bin/sleep 10
${IP} addr show ${TUN_INTERFACE} > /dev/null 2>&1 ${IP} addr show ${TUN_INTERFACE} > /dev/null 2>&1
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
tunIPs=$(${IP} addr show ${TUN_INTERFACE} | ${GREP} -e "inet" | \ tunIPs=$(${IP} addr show ${TUN_INTERFACE} | ${GREP} -e "inet" | \
awk '{print $2}') 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}." established using IP ${tunIPs}."
else else
${LOGGER} -i -p user.err "${LOGERROR} Could not establish VPN \ ${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