diff options
author | Tom Gundersen <teg@jklm.no> | 2012-07-18 17:45:50 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2012-07-18 17:45:50 +0200 |
commit | 8d84c52feb46129551a36d59aba1d108015c7658 (patch) | |
tree | 926841465000c07d40258dee88aae559af440d44 | |
parent | 1a57fcba0bcf13fcd0b99a14619e4e8992b52c58 (diff) | |
download | initscripts-8d84c52feb46129551a36d59aba1d108015c7658.tar.xz |
network: don't complain about missing or invalid interface
If the interface is missing and we use dhcpcd, we do the right thing.
Otherwise, ip or dhcpcd will complain for us.
Signed-off-by: Tom Gundersen <teg@jklm.no>
-rwxr-xr-x | network | 17 |
1 files changed, 1 insertions, 16 deletions
@@ -23,24 +23,9 @@ deprecated() { printf " connection, or use a utility such as netcfg.\n" } -have_interface() { - if [[ -z $1 ]]; then - printf "\n${C_FAIL}Error:${C_CLEAR} \`interface' is undefined in /etc/rc.conf\n" - return 1 - fi - - if [[ ! -d /sys/class/net/$1 ]]; then - printf "\n${C_FAIL}Error:${C_CLEAR} unknown interface in /etc/rc.conf: \`%s'\n" "$1" - return 1 - fi -} - network_up() { - have_interface "$interface" || return 1 - - ip link set dev $interface up || return 1 - if [[ $address ]]; then + ip link set dev $interface up || return 1 ip addr add $address/${netmask:-24} broadcast ${broadcast:-+} dev $interface || return 1 [[ $gateway ]] && { ip route add default via $gateway || return 1; } else |