diff options
-rw-r--r-- | configure.ac | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | t_client.sh.in (renamed from t_client.sh) | 28 |
2 files changed, 22 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index c817938..4777108 100644 --- a/configure.ac +++ b/configure.ac @@ -266,6 +266,13 @@ AC_ARG_WITH(route-path, ) AC_DEFINE_UNQUOTED(ROUTE_PATH, "$ROUTE", [Path to route tool]) +AC_ARG_WITH(netstat-path, + [ --with-netstat-path=PATH Path to netstat tool], + [NETSTAT="$withval"], + [AC_PATH_PROG([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc])] +) +AC_DEFINE_UNQUOTED(NETSTAT_PATH, "$NETSTAT", [Path to netstat tool]) + AC_ARG_WITH(mem-check, [ --with-mem-check=TYPE Build with debug memory checking, TYPE = dmalloc or valgrind], [MEMCHECK="$withval"] @@ -913,6 +920,7 @@ if test -z "${htmldir}"; then fi # end workaround +AC_CONFIG_FILES([t_client.sh], [chmod +x t_client.sh]) AC_OUTPUT([ Makefile openvpn.spec diff --git a/t_client.sh b/t_client.sh.in index 3a0dadb..664b2fd 100644..100755 --- a/t_client.sh +++ b/t_client.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@SHELL@ # # run OpenVPN client against ``test reference'' server # - check that ping, http, ... via tunnel works @@ -79,13 +79,13 @@ fail() # this is higly system dependent... get_ifconfig_route() { - # linux / iproute2? - if [ -x /sbin/ip -o -x /usr/sbin/ip ] + # linux / iproute2? (-> if configure got a path) + if [ "@IPROUTE@" != "ip" ] then echo "-- linux iproute2 --" - ip addr show | grep -v valid_lft - ip route show - ip -6 route show | sed -e 's/expires [0-9]*sec //' + @IPROUTE@ addr show | grep -v valid_lft + @IPROUTE@ route show + @IPROUTE@ -6 route show | sed -e 's/expires [0-9]*sec //' return fi @@ -93,27 +93,27 @@ get_ifconfig_route() case `uname -s` in Linux) echo "-- linux / ifconfig --" - LANG=C ifconfig -a |egrep "( addr:|encap:)" - LANG=C netstat -rn -4 -6 + LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)" + LANG=C @NETSTAT@ -rn -4 -6 return ;; FreeBSD|NetBSD|Darwin) echo "-- FreeBSD/NetBSD/Darwin [MacOS X] --" - ifconfig -a | egrep "(flags=|inet)" - netstat -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' + @IFCONFIG@ -a | egrep "(flags=|inet)" + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' return ;; OpenBSD) echo "-- OpenBSD --" - ifconfig -a | egrep "(flags=|inet)" | \ + @IFCONFIG@ -a | egrep "(flags=|inet)" | \ sed -e 's/pltime [0-9]*//' -e 's/vltime [0-9]*//' - netstat -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' return ;; SunOS) echo "-- Solaris --" - ifconfig -a | egrep "(flags=|inet)" - netstat -rn + @IFCONFIG@ -a | egrep "(flags=|inet)" + @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' return ;; esac |