aboutsummaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
Diffstat (limited to 'network')
-rwxr-xr-xnetwork17
1 files changed, 1 insertions, 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