aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-08-18 00:56:08 +0000
committerBill Nottingham <notting@redhat.com>2003-08-18 00:56:08 +0000
commit3d5f9d480782d7007e15c3b1d97e2ee56a206ad5 (patch)
tree42d90df5f8f5c737bb6f3f67f997c6827aa8a9eb
parentf03f0eaf965af22ea0fd9ebc8a096cd4aac0426c (diff)
downloadinitscripts-3d5f9d480782d7007e15c3b1d97e2ee56a206ad5.tar
initscripts-3d5f9d480782d7007e15c3b1d97e2ee56a206ad5.tar.gz
initscripts-3d5f9d480782d7007e15c3b1d97e2ee56a206ad5.tar.bz2
initscripts-3d5f9d480782d7007e15c3b1d97e2ee56a206ad5.tar.xz
initscripts-3d5f9d480782d7007e15c3b1d97e2ee56a206ad5.zip
more IPv6 tweaks (<pekkas@netcore.fi>); sort | uniq -> sort -u
-rwxr-xr-xsysconfig/network-scripts/init.ipv6-global6
-rw-r--r--sysconfig/network-scripts/network-functions-ipv618
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