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

BFO2LSDF [FIX]: output only IPv4 address

BFO2LSDF uses /bin/ip to check for an active VPN tunnel. It reports the IP
address to the system logger. /bin/ip reports the IPv4 and the IPv6 address,
which produced a line break in the output of the previous version of BFO2LSDF,
which in turn confused the log-file parser in csbackntfy. The current version
only outputs the IPv4 address.
parent 7b0621b9
......@@ -32,6 +32,7 @@
# 02/09/2016 V1.7 make program fit for bromo:
# - support dry-run
# - use openvpn instead of vpnc
# 03/09/2016 V1.8 report only IPv4 address
#
# ============================================================================
#
......@@ -93,8 +94,8 @@ do
${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}')
tunIPs=$(${IP} addr show ${TUN_INTERFACE} | ${GREP} -e "inet " | \
head -n 1 | awk '{print $2}')
${LOGGER} -i -p user.info "${LOGINFO} VPN connection already had been \
established using IP ${tunIPs}."
else
......@@ -110,8 +111,8 @@ do
${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}')
tunIPs=$(${IP} addr show ${TUN_INTERFACE} | ${GREP} -e "inet " | \
head -n 1 | awk '{print $2}')
${LOGGER} -i -p user.info "${LOGINFO} VPN connection is \
established using IP ${tunIPs}."
else
......
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