diff options
author | Roy Marples <roy@marples.name> | 2007-04-16 12:56:43 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-04-16 12:56:43 +0000 |
commit | 757b8bcc968fa285e3d78435e30b6c47abc048dc (patch) | |
tree | d1eee1629f862e3cc784bb9fb28d5c3a5cc62110 /net.Linux | |
parent | 74527291b51ac81a87c579aeb655fdc91faa40ab (diff) |
Don't search for a space after interface names in /proc/net, #174792 thanks to Mike Auty.
Diffstat (limited to 'net.Linux')
-rw-r--r-- | net.Linux/ifconfig.sh | 6 | ||||
-rw-r--r-- | net.Linux/iproute2.sh | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/net.Linux/ifconfig.sh b/net.Linux/ifconfig.sh index 0b0af979..68590bbe 100644 --- a/net.Linux/ifconfig.sh +++ b/net.Linux/ifconfig.sh @@ -15,7 +15,7 @@ _down() { } _exists() { - grep -Eq "^[[:space:]]*${IFACE}:[[:space:]]*" /proc/net/dev + grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev } _ifindex() { @@ -24,7 +24,7 @@ _ifindex() { i=$((${i} + 1)) [ ${i} -lt 1 ] && continue case "${line}" in - "${IFACE}: "*) echo "${i}"; return 0;; + "${IFACE}:"*) echo "${i}"; return 0;; esac done < /proc/net/dev return 1 @@ -35,7 +35,7 @@ _is_wireless() { [ -d /sys/class/net/"${IFACE}"/wireless ] && return 0 [ ! -e /proc/net/wireless ] && return 1 - grep -Eq "^[[:space:]]*${IFACE}:[[:space:]]+" /proc/net/wireless + grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/wireless } _get_mac_address() { diff --git a/net.Linux/iproute2.sh b/net.Linux/iproute2.sh index ccab1dbf..2c02b40d 100644 --- a/net.Linux/iproute2.sh +++ b/net.Linux/iproute2.sh @@ -7,7 +7,6 @@ iproute2_depend() { after ifconfig } - _up() { ip link set up dev "${IFACE}" } @@ -17,7 +16,7 @@ _down() { } _exists() { - grep -Eq "^[[:space:]]*${IFACE}:[[:space:]]*" /proc/net/dev + grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev } _ifindex() { @@ -26,7 +25,7 @@ _ifindex() { i=$((${i} + 1)) [ ${i} -lt 1 ] && continue case "${line}" in - "${IFACE}: "*) echo "${i}"; return 0;; + "${IFACE}:"*) echo "${i}"; return 0;; esac done < /proc/net/dev return 1 @@ -37,7 +36,7 @@ _is_wireless() { [ -d /sys/class/net/"${IFACE}"/wireless ] && return 0 [ ! -e /proc/net/wireless ] && return 1 - grep -Eq "^[[:space:]]*${IFACE}:[[:space:]]+" /proc/net/wireless + grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/wireless } _get_mac_address() { |