aboutsummaryrefslogtreecommitdiffstats
path: root/ppp/ip-up.ipv6to4
diff options
context:
space:
mode:
Diffstat (limited to 'ppp/ip-up.ipv6to4')
-rw-r--r--ppp/ip-up.ipv6to410
1 files changed, 5 insertions, 5 deletions
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