diff options
Diffstat (limited to 'net.Linux/iproute2.sh')
-rw-r--r-- | net.Linux/iproute2.sh | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/net.Linux/iproute2.sh b/net.Linux/iproute2.sh index 1b1b70fa..ccab1dbf 100644 --- a/net.Linux/iproute2.sh +++ b/net.Linux/iproute2.sh @@ -7,21 +7,6 @@ iproute2_depend() { after ifconfig } -_get_mac_address() { - local mac=$(LC_ALL=C ip link show "${IFACE}" | sed -n \ - -e 'y/abcdef/ABCDEF/' \ - -e '/link\// s/^.*\<\(..:..:..:..:..:..\)\>.*/\1/p') - - case "${mac}" in - 00:00:00:00:00:00) ;; - 44:44:44:44:44:44) ;; - FF:FF:FF:FF:FF:FF) ;; - "") ;; - *) echo "${mac}"; return 0 ;; - esac - - return 1 -} _up() { ip link set up dev "${IFACE}" @@ -55,6 +40,26 @@ _is_wireless() { grep -Eq "^[[:space:]]*${IFACE}:[[:space:]]+" /proc/net/wireless } +_get_mac_address() { + local mac=$(LC_ALL=C ip link show "${IFACE}" | sed -n \ + -e 'y/abcdef/ABCDEF/' \ + -e '/link\// s/^.*\<\(..:..:..:..:..:..\)\>.*/\1/p') + + case "${mac}" in + 00:00:00:00:00:00) ;; + 44:44:44:44:44:44) ;; + FF:FF:FF:FF:FF:FF) ;; + "") ;; + *) echo "${mac}"; return 0 ;; + esac + + return 1 +} + +_set_mac_address() { + ip link set address "$1" dev "${IFACE}" +} + _get_inet_addresses() { LC_ALL=C ip -family inet addr show "${IFACE}" | \ sed -n -e 's/.*inet \([^ ]*\).*/\1/p' @@ -160,8 +165,9 @@ iproute2_pre_start() { metric=1000 ebegin "Creating tunnel ${IFVAR}" - ip tunnel add "${tunnel}" + ip tunnel add ${tunnel} name "${IFACE}" eend $? || return 1 + _up fi return 0 |