# HG changeset patch # User "Yann E. MORIN" # Date 1208714660 0 # Node ID 2969b1d3884a873b5f0d6e16ee9e94c954c79843 # Parent 15fdb2eb2db3822af962fdbe4d1c27cf7ac79a9b Tss.... I was bieng real stupid while building up the tsocks.conf file. Implement a much simpler way. /trunk/scripts/crosstool.sh | 27 5 22 0 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff -r 15fdb2eb2db3 -r 2969b1d3884a scripts/crosstool.sh --- a/scripts/crosstool.sh Sun Apr 20 16:46:17 2008 +0000 +++ b/scripts/crosstool.sh Sun Apr 20 18:04:20 2008 +0000 @@ -233,28 +233,11 @@ # Remove any lingering config file from any previous run rm -f "${CT_BUILD_DIR}/tsocks.conf" # Find all interfaces and build locally accessible networks - /sbin/ifconfig |gawk ' - $0 ~ /inet addr:/ { - split( $2, ip, ":|\\." ); - ip_num = ip[2]*2^24 + ip[3]*2^16 + ip[4]*2^8 + ip[5]*2^0; - # Skip 127.0.0.1 - if( ip_num == 2130706433 ) { - next; - } - split( $(NF), mask, ":|\\." ); - mask_num = mask[2]*2^24 + mask[3]*2^16 + mask[4]*2^8 + mask[5]*2^0; - ip_num = and( ip_num, mask_num ); - printf( "local = %d.%d.%d.%d/%d.%d.%d.%d\n", - and( 0xFF, rshift( ip_num, 24 ) ), - and( 0xFF, rshift( ip_num, 16 ) ), - and( 0xFF, rshift( ip_num, 8 ) ), - and( 0xFF, rshift( ip_num, 0 ) ), - and( 0xFF, rshift( mask_num, 24 ) ), - and( 0xFF, rshift( mask_num, 16 ) ), - and( 0xFF, rshift( mask_num, 8 ) ), - and( 0xFF, rshift( mask_num, 0 ) ) ); - } - ' >"${CT_BUILD_DIR}/tsocks.conf" + /sbin/ifconfig |egrep 'inet addr' |while read inet addr bcast mask; do + ip="${addr/*:}" + mask="${mask/*:}" + [ -n "${mask}" -a "${ip}" != "127.0.0.1" ] && echo "local = ${ip}/${mask}" + done >"${CT_BUILD_DIR}/tsocks.conf" ( echo "server = ${CT_PROXY_HOST}"; echo "server_port = ${CT_PROXY_PORT}"; [ -n "${CT_PROXY_USER}" ] && echo "default_user=${CT_PROXY_USER}";