Changeset 84d8293 in lab.git for iptables


Ignore:
Timestamp:
Jul 6, 2009 2:49:54 PM (15 years ago)
Author:
mitty <mitty@…>
Branches:
master, trunk
Children:
c8daa69
Parents:
71b798c
Message:
  • FIX: use 'tr' to replace repeated SPACE with a single SPACE before 'cut' lines

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@14 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • iptables/setnapt.sh

    rc109418 r84d8293  
    3131 
    3232if [ -z "${GATEWAYS}" ]; then 
    33     GATEWAYS=`/sbin/ip route show table main | grep -w default | cut -d ' ' -f 5` 
     33    GATEWAYS=`/sbin/ip route show table main | grep -w default | tr -s ' ' | cut -d ' ' -f 5` 
    3434fi 
    3535 
     
    4040    fi 
    4141     
    42     IPADDR=`/sbin/ip addr show dev ${GW} | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1` 
     42    IPADDR=`/sbin/ip addr show dev ${GW} | grep -w inet | tr -s ' ' | cut -d ' ' -f 3 | cut -d / -f 1` 
    4343    if [ -z "${IPADDR}" ]; then 
    4444        # device doesn't seem to have an IP address 
Note: See TracChangeset for help on using the changeset viewer.