diff options
Diffstat (limited to 'net.BSD/ifconfig.sh')
-rw-r--r-- | net.BSD/ifconfig.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh index 06be70cf..92a77338 100644 --- a/net.BSD/ifconfig.sh +++ b/net.BSD/ifconfig.sh @@ -78,6 +78,12 @@ _get_inet_address() { } _add_address() { + local inet6= + + case "$@" in + *:*) inet6=inet6 ;; + esac + if [ "${metric:-0}" != "0" ] ; then set -- "$@" metric ${metric} fi @@ -94,10 +100,7 @@ _add_address() { ;; esac - case "$@" in - *:*) ifconfig "${IFACE}" inet6 "$@" ;; - *) ifconfig "${IFACE}" "$@" ;; - esac + ifconfig "${IFACE}" ${inet6} alias "$@" } _add_route() { |