diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-16 21:57:12 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-16 21:57:12 (GMT) |
commit | 78d1209616f2377087e5b9dca15017fdf122c106 (patch) | |
tree | bdfb48996568082155d4dc18bf808e46c3ea6045 | |
parent | e30048ee15082b0150545a158eff1d0725aa50f3 (diff) |
Move the check for tsocks' availability just before using tsocks: make it clear we check before we use.
Use CT_DoExecLog to validate tsocks configuration.
Don't use gawk, but awk. awk *is* GNU awk, check by ./configure.
/trunk/scripts/crosstool.sh | 9 5 4 0 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
-rwxr-xr-x | scripts/crosstool.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh index 6002e44..4adccd4 100755 --- a/scripts/crosstool.sh +++ b/scripts/crosstool.sh @@ -235,13 +235,12 @@ case "${CT_PROXY_TYPE}" in CT_DoLog DEBUG "http_proxy='${http_proxy}'" ;; sockssys) - CT_HasOrAbort tsocks # Force not using HTTP proxy unset http_proxy ftp_proxy https_proxy + CT_HasOrAbort tsocks . tsocks -on ;; socks*) - CT_HasOrAbort tsocks # Force not using HTTP proxy unset http_proxy ftp_proxy https_proxy # Remove any lingering config file from any previous run @@ -249,7 +248,7 @@ case "${CT_PROXY_TYPE}" in # Find all interfaces and build locally accessible networks server_ip=$(ping -c 1 -W 2 "${CT_PROXY_HOST}" |head -n 1 |sed -r -e 's/^[^\(]+\(([^\)]+)\).*$/\1/;' || true) CT_TestOrAbort "SOCKS proxy '${CT_PROXY_HOST}' has no IP." -n "${server_ip}" - /sbin/ifconfig |gawk -v server_ip="${server_ip}" ' + /sbin/ifconfig |awk -v server_ip="${server_ip}" ' BEGIN { split( server_ip, tmp, "\\." ); server_ip_num = tmp[1] * 2^24 + tmp[2] * 2^16 + tmp[3] * 2^8 + tmp[4] * 2^0; @@ -308,7 +307,9 @@ case "${CT_PROXY_TYPE}" in ;; esac echo "server_type = ${proxy_type}" >> "${CT_BUILD_DIR}/tsocks.conf" - validateconf -f "${CT_BUILD_DIR}/tsocks.conf" 2>&1 |CT_DoLog DEBUG + CT_HasOrAbort tsocks + # If tsocks was found, then validateconf is present (distributed with tsocks). + CT_DoExecLog DEBUG validateconf -f "${CT_BUILD_DIR}/tsocks.conf" export TSOCKS_CONF_FILE="${CT_BUILD_DIR}/tsocks.conf" . tsocks -on ;; |