diff options
author | Bill Nottingham <notting@redhat.com> | 2003-08-18 00:54:08 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2003-08-18 00:54:08 +0000 |
commit | 9ea908dbebf85d23c8001a15e27a62412c0e030e (patch) | |
tree | e583d419344a7f32dc38066953e6f7d0d27d3058 /sysconfig | |
parent | a1c0c7fe4afb3e76fe387d67216e9a7ec72b23eb (diff) | |
download | initscripts-9ea908dbebf85d23c8001a15e27a62412c0e030e.tar initscripts-9ea908dbebf85d23c8001a15e27a62412c0e030e.tar.gz initscripts-9ea908dbebf85d23c8001a15e27a62412c0e030e.tar.bz2 initscripts-9ea908dbebf85d23c8001a15e27a62412c0e030e.tar.xz initscripts-9ea908dbebf85d23c8001a15e27a62412c0e030e.zip |
more IPv6 tweaks (<pekkas@netcore.fi>)
sort | uniq -> sort -u
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/init.ipv6-global | 6 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions-ipv6 | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sysconfig/network-scripts/init.ipv6-global b/sysconfig/network-scripts/init.ipv6-global index 18163b81..79ef9949 100755 --- a/sysconfig/network-scripts/init.ipv6-global +++ b/sysconfig/network-scripts/init.ipv6-global @@ -68,7 +68,7 @@ case $ACTION in fi # Reset IPv6 sysctl switches for "all", "default" and still existing devices - sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort | uniq | while read interface; do + sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort -u | while read interface; do # Host/Router behaviour for the interface ipv6_exec_sysctl -w net.ipv6.conf.$interface.forwarding=$ipv6_global_forwarding >/dev/null 2>&1 @@ -137,7 +137,7 @@ case $ACTION in ipv6_test testonly || exit 0 - sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort | uniq | while read interface; do + sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort -u | while read interface; do # Assume Host behaviour ipv6_exec_sysctl -w net.ipv6.conf.$interface.forwarding=0 >/dev/null 2>&1 @@ -170,7 +170,7 @@ case $ACTION in # Show sysctl switches sysctl -a | grep "^net\.ipv6\.conf\.default\." | awk -F. '{ print $5 }' | awk -F= '{ print $1 }' | sed 's/ //g' | while read switch; do - sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort | uniq | while read interface; do + sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort -u | while read interface; do sysctl net.ipv6.conf.$interface.$switch done echo diff --git a/sysconfig/network-scripts/network-functions-ipv6 b/sysconfig/network-scripts/network-functions-ipv6 index 189dacf1..bf9a4576 100644 --- a/sysconfig/network-scripts/network-functions-ipv6 +++ b/sysconfig/network-scripts/network-functions-ipv6 @@ -297,7 +297,7 @@ ipv6_control_forwarding() { return 1 fi - ipv6_test || return 2 + ipv6_test || return 2 if [ "$fw_control" = "yes" -o "$fw_control" = "on" ]; then local status=1 @@ -343,7 +343,7 @@ ipv6_add_route() { return 1 fi - ipv6_test || return 2 + ipv6_test || return 2 ipv6_test_ipv6_addr_valid $networkipv6 || return 2 ipv6_test_ipv6_addr_valid $gatewayipv6 || return 2 @@ -472,7 +472,7 @@ ipv6_cleanup_routes() { ipv6_enable_autotunnel() { local fn="ipv6_enable_autotunnel" - ipv6_test || return 2 + ipv6_test || return 2 # enable IPv6-over-IPv4 tunnels if ipv6_test_device_status sit0; then @@ -583,7 +583,7 @@ ipv6_test_addr_exists_on_device() { fi else # low budget version, only works if given address is in equal form like "ip" displays - local testresult="`ipv6_exec_ip addr show dev $testdevice | LC_ALL=C grep inet6 | awk '{ print $2 }' | LC_ALL=C grep -i "^$testaddr/$testprefix$"`" + local testresult="`ipv6_exec_ip addr show dev $testdevice | LC_ALL=C grep -w inet6 | awk '{ print $2 }' | LC_ALL=C grep -i "^$testaddr/$testprefix$"`" if [ -n "$testresult" ]; then # exists return 0 @@ -638,7 +638,7 @@ ipv6_test_addrprefix_exists_on_device() { ## Add an IPv6 address for given interface # $1: <Interface> -# $2: <IPv6 address> +# $2: <IPv6 address[/prefix]> # return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem ipv6_add_addr_on_device() { local fn="ipv6_add_addr_on_device" @@ -819,7 +819,7 @@ ipv6_test_ipv6_addr_valid() { fi else # Test for a valid format - if ! echo "$address_implicit" | LC_ALL=C egrep -q '^[:xdigit:]|[:\.]*$'; then + if ! echo "$address_implicit" | LC_ALL=C egrep -q '^[[:xdigit:]]|[:\.]*$'; then if [ "$modequiet" != "quiet" ]; then ipv6_log $"Given IPv6 address '$testipv6addr_valid' is not valid" err $fn fi @@ -1187,7 +1187,7 @@ ipv6_add_tunnel_device() { local addressipv4tunnellocal="any" fi - ipv6_test || return 2 + ipv6_test || return 2 if ! ipv6_test_device_status $device; then local ttldefault="`ipv6_exec_sysctl net.ipv4.ip_default_ttl | awk '{ print $3 }'`" @@ -1196,7 +1196,7 @@ ipv6_add_tunnel_device() { fi # Test whether remote IPv4 address was already applied to another tunnel (does not catch IPv4 addresses with leading 0's) - ipv6_exec_ip tunnel show 2>/dev/null | LC_ALL=C grep -w "ipv6/ip" | LC_ALL=C grep $addressipv4tunnel | while read dev type tag remote tag local tag ttl rest; do + ipv6_exec_ip tunnel show 2>/dev/null | LC_ALL=C grep -w "ipv6/ip" | LC_ALL=C grep "$addressipv4tunnel" | while read dev type tag remote tag local tag ttl rest; do local devnew="`echo $dev | sed 's/:$//g'`" if [ "$remote" = "$addressipv4tunnel" ]; then ipv6_log $"Given remote address '$addressipv4tunnel' on tunnel device '$device' is already configured on device '$devnew'" err $fn @@ -1381,7 +1381,7 @@ ipv6_get_ipv4addr_of_device() { fi # Device exists, retrieve address - local ipv4addr="`ipv6_exec_ip -4 addr show dev $device | grep -w "inet" | awk '{ print $2 }' | awk -F/ '{ print $1 }'`" + local ipv4addr="`ipv6_exec_ip -4 addr show dev $device | LC_ALL=C grep -w "inet" | awk '{ print $2 }' | awk -F/ '{ print $1 }'`" if [ $? != 0 ]; then return 3 |