diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2010-02-21 21:21:48 +0200 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2011-02-28 15:31:44 -0500 |
commit | 5212d0a596d67bbd2f5effdd3686c123f778078f (patch) | |
tree | 78f41b7fd9ed97f6326a61c7da25f0b9fabec0df /ppp | |
parent | 681717364c786083356ebe5d92c4cc6fd73af307 (diff) | |
download | initscripts-5212d0a596d67bbd2f5effdd3686c123f778078f.tar initscripts-5212d0a596d67bbd2f5effdd3686c123f778078f.tar.gz initscripts-5212d0a596d67bbd2f5effdd3686c123f778078f.tar.bz2 initscripts-5212d0a596d67bbd2f5effdd3686c123f778078f.tar.xz initscripts-5212d0a596d67bbd2f5effdd3686c123f778078f.zip |
Drop some unnecessary command invocations.
Diffstat (limited to 'ppp')
-rw-r--r-- | ppp/ip-down.ipv6to4 | 4 | ||||
-rw-r--r-- | ppp/ip-up.ipv6to4 | 10 | ||||
-rw-r--r-- | ppp/ipv6-up | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/ppp/ip-down.ipv6to4 b/ppp/ip-down.ipv6to4 index d6e50b54..29f1c646 100644 --- a/ppp/ip-down.ipv6to4 +++ b/ppp/ip-down.ipv6to4 @@ -48,7 +48,7 @@ CONFIG=$1 source_config # IPv6 don't need aliases anymore, config is skipped -REALDEVICE=$(echo ${DEVICE} | sed 's/:.*//g') +REALDEVICE=${DEVICE%%:*} [ "$DEVICE" != "$REALDEVICE" ] && exit 0 if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then @@ -104,7 +104,7 @@ if [ "$valid6to4config" = "yes" ]; then if [ -n "$IPV6TO4_ROUTING" ]; then # Delete routes to local networks for devsuf in $IPV6TO4_ROUTING; do - dev="$(echo $devsuf | awk -F- '{ print $1 }')" + dev="${devsuf%%-*}" ipv6_cleanup_6to4_device $dev done fi diff --git a/ppp/ip-up.ipv6to4 b/ppp/ip-up.ipv6to4 index b2f6e6e6..6343fbc5 100644 --- a/ppp/ip-up.ipv6to4 +++ b/ppp/ip-up.ipv6to4 @@ -54,7 +54,7 @@ CONFIG=$1 source_config # IPv6 don't need aliases anymore, config is skipped -REALDEVICE=$(echo ${DEVICE} | sed 's/:.*//g') +REALDEVICE=${DEVICE%%:*} [ "$DEVICE" != "$REALDEVICE" ] && exit 0 if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then @@ -104,7 +104,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then if [ "$valid6to4config" = "yes" ]; then # Delete routes to local networks for devsuf in $IPV6TO4_ROUTING; do - dev="$(echo $devsuf | awk -F- '{ print $1 }')" + dev="${devsuf%%-*}" ipv6_cleanup_6to4_device $dev done @@ -112,7 +112,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then ipv6_cleanup_6to4_tunnels tun6to4 # Get MTU of master device - ipv4mtu="$(/sbin/ip link show dev $DEVICE | grep -w "mtu" | awk '{ print $5 }')" + ipv4mtu="$(/sbin/ip link show dev $DEVICE | awk '/\<mtu\>/ { print $5 }')" if [ -n "$ipv4mtu" ]; then # IPv6 tunnel MTU is IPv4 MTU minus 20 for IPv4 header tunnelmtu=$[ $ipv4mtu - 20 ] @@ -155,7 +155,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then # Setup additional static IPv6 routes (newer config style) if [ -f "/etc/sysconfig/network-scripts/route6-tun6to4" ]; then - cat "/etc/sysconfig/network-scripts/route6-tun6to4" | sed 's/#.*//g' | grep -v '^[[:space:]]*$' | while read line; do + sed -ne 's/#.*//' -e '/[^[:space:]]/p' /etc/sysconfig/network-scripts/route6-tun6to4 | while read line; do if echo "$line" | grep -vq 'via'; then # Add gateway if missing line="$line via $ipv6to4_relay" @@ -178,7 +178,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then if [ -n "$ipv6to4prefix" ]; then # Add IPv6 address to interface (required interface route will be set automatically) for devsuf in $IPV6TO4_ROUTING; do - dev="$(echo $devsuf | awk -F- '{ print $1 }')" + dev="${devsuf%%-*}" suf="$(echo $devsuf | awk -F- '{ print $2 }')" ipv6_add_addr_on_device ${dev} ${ipv6to4prefix}${suf} done diff --git a/ppp/ipv6-up b/ppp/ipv6-up index 06062cfa..54219e43 100644 --- a/ppp/ipv6-up +++ b/ppp/ipv6-up @@ -97,7 +97,7 @@ fi # Setup additional static IPv6 routes (newer config style) if [ -f "/etc/sysconfig/network-scripts/route6-$DEVICE" ]; then - cat "/etc/sysconfig/network-scripts/route6-$DEVICE" | sed 's/#.*//g' | grep -v '^[[:space:]]*$' | while read line; do + sed -ne 's/#.*//' -e '/[^[:space:]]/p' "/etc/sysconfig/network-scripts/route6-$DEVICE" | while read line; do /sbin/ip -6 route add $line done fi |