From 8d84c52feb46129551a36d59aba1d108015c7658 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 18 Jul 2012 17:45:50 +0200 Subject: 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 --- network | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/network b/network index 494a11f..14774e3 100755 --- a/network +++ b/network @@ -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 -- cgit v1.2.3