]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/openslug-init/openslug-init-0.10/boot/network
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / openslug-init / openslug-init-0.10 / boot / network
1 #!/bin/sh
2 # bring up the network before boot, used to allow
3 # netconsole logging and NFS boot.  This runs out
4 # of flash, but that's ok because the script doesn't
5 # leave any process running.
6 #
7 # NOTE: /etc/default/functions defines ifup as a shell
8 # function!
9 . /etc/default/functions
10 #
11 # Now all the information for booting should be in the configuration
12 # file.  Config the loopback and network interfaces.
13 ifconfig lo 127.0.0.1 up
14 mac="$(config mac)"
15 iface="$(config iface)"
16 if test -n "$mac" -a -n "$iface" -a "$mac" != "00:00:00:00:00:00" -a "$mac" != "FF:FF:FF:FF:FF:FF"
17 then
18         if ifconfig "$iface" hw ether "$mac" &&
19            ifup "$iface"
20         then
21                 exit 0
22         fi
23 fi
24 # exit code is true only if the interface config has succeeded
25 exit 1