You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
450 B
Bash
17 lines
450 B
Bash
#!/bin/sh
|
|
|
|
preinit_ip() {
|
|
# if the preinit interface isn't specified and ifname is set in
|
|
# preinit.arch use that interface
|
|
if [ -z "$pi_ifname" ]; then
|
|
pi_ifname=$ifname
|
|
fi
|
|
|
|
[ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
|
|
ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up
|
|
|
|
local try=0;
|
|
while [ $((try++)) -le 5 ] && [ ! "$(cat /sys/class/net/$pi_ifname/operstate)" = "up" ]; do sleep 1; done
|
|
}
|
|
}
|