Skip to content
Snippets Groups Projects
Commit 0f1ae840 authored by Jonas Gorski's avatar Jonas Gorski
Browse files

base-files: split out preinit interface config


Move preinit interface and ip config to its own function to allow
calling it from more than one place.

Signed-off-by: default avatarJonas Gorski <jonas.gorski@gmail.com>
parent 780ccbf9
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,13 @@
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
preinit_ip_config() {
grep -q "$1" /proc/net/dev || return
ip link set dev $1 up
ip -4 address add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $1
}
preinit_ip() {
# if the preinit interface isn't specified and ifname is set in
# preinit.arch use that interface
......@@ -9,10 +16,9 @@ preinit_ip() {
pi_ifname=$ifname
fi
[ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
ip link set dev $pi_ifname up
ip -4 address add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $pi_ifname
}
if [ -n "$pi_ifname" ]; then
preinit_ip_config $pi_ifname
fi
}
preinit_ip_deconfig() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment