Commit 952dce70 authored by thomas.forbriger's avatar thomas.forbriger

[FEATURE] (csback, BFO2LSDF): re-establish VPN tunnel

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.
parent 0a2bcae3
......@@ -26,7 +26,8 @@
# 10/09/2012 V1.1 set bandwidth limit for rsync
# 05/02/2013 V1.2 print rsync EXIT CODE to log message
# 03/07/2014 V1.4 add DL1 data directory
# 07/07/2014 V1.5 systematically missed rsync exit status
# 07/07/2014 V1.5 - systematically missed rsync exit status
# - re-establish VPN tunnel for each directory
#
# ============================================================================
#
......@@ -72,30 +73,6 @@ with PID $p."
done
fi
# establish VPN connection to KIT
${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 \
established using IP ${tunIPs}."
else
# start juniper network client
${JNC} --nox kit > /dev/null 2>&1
if [ $? -ne 0 ]
then
${LOGGER} -i -p user.err "${LOGERROR} Could not establish VPN \
connection."
exit 2
else
tunIPs=$(${IP} addr show ${TUN_INTERFACE} | ${GREP} -e "inet" | \
awk '{print $2}')
${LOGGER} -i -p user.info "${LOGINFO} VPN connection successfully \
established using IP ${tunIPs}."
fi
fi
# keychain related
source $HOME/.keychain/$HOSTNAME-sh
......@@ -103,6 +80,30 @@ SSHCMD="/usr/bin/ssh -i $HOME/.ssh/BFOLSDFoper"
# transfer data
for i in ${!DATADIRS[*]}
do
# establish VPN connection to KIT
${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 \
established using IP ${tunIPs}."
else
# start juniper network client
${JNC} --nox kit > /dev/null 2>&1
if [ $? -ne 0 ]
then
${LOGGER} -i -p user.err "${LOGERROR} Could not establish VPN \
connection."
exit 2
else
tunIPs=$(${IP} addr show ${TUN_INTERFACE} | ${GREP} -e "inet" | \
awk '{print $2}')
${LOGGER} -i -p user.info "${LOGINFO} VPN connection successfully \
established using IP ${tunIPs}."
fi
fi
# copy data (compressed)
${LOGGER} -i -p user.info "${LOGINFO}\
${RSYNC} -v -z -a --protocol=29 --bwlimit ${BWLIMIT} ${EXCLUDE} \
......
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