From: Samuli Seppänen <sam...@openvpn.net> Previously, if t_client.rc did not source t_client_ips.rc, update_t_client_ips.sh would add (the same) EXPECT_IFCONFIG entries to t_client_ips.rc on every run. This patch makes update_t_client_ips.sh check if the entry exists before trying to add it.
Signed-off-by: Samuli Seppänen <sam...@openvpn.net> --- tests/update_t_client_ips.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/update_t_client_ips.sh b/tests/update_t_client_ips.sh index e7b58ba..438220d 100755 --- a/tests/update_t_client_ips.sh +++ b/tests/update_t_client_ips.sh @@ -3,5 +3,14 @@ # This --up script caches the IPs handed out by the test VPN server to a file # for later use. -echo "EXPECT_IFCONFIG4_$TESTNUM=$ifconfig_local" >> $TOP_BUILDDIR/t_client_ips.rc -echo "EXPECT_IFCONFIG6_$TESTNUM=$ifconfig_ipv6_local" >> $TOP_BUILDDIR/t_client_ips.rc +RC="$TOP_BUILDDIR/t_client_ips.rc" + +grep EXPECT_IFCONFIG4_$TESTNUM $RC > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "EXPECT_IFCONFIG4_$TESTNUM=$ifconfig_local" >> $RC +fi + +grep EXPECT_IFCONFIG6_$TESTNUM $RC > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "EXPECT_IFCONFIG6_$TESTNUM=$ifconfig_ipv6_local" >> $RC +fi -- 2.1.4 ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel