diff options
Diffstat (limited to 'projectroot/etc/init.d/networking')
-rw-r--r-- | projectroot/etc/init.d/networking | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/projectroot/etc/init.d/networking b/projectroot/etc/init.d/networking new file mode 100644 index 000000000..4b82262d8 --- /dev/null +++ b/projectroot/etc/init.d/networking @@ -0,0 +1,35 @@ +#!/bin/sh + +echo "starting network interfaces..." + +grep "root=/dev/nfs" /proc/cmdline > /dev/null + +if [ $? != 0 ]; then + ifup -a +else + # We are doing nfsroot. We cannot simply call ifup -a + # here because we will run into trouble with dhcp. + # So we call ifup for every interface except the one + # we are doing nfsroot on. + # + if [ ! -f /etc/network/interfaces ]; then + exit 0 + fi + + ifaces=$(grep "^auto" /etc/network/interfaces) + + for i in $ifaces; do + if [ "$i" = auto ]; then + continue + fi + + ifconfig | grep "^$i" + + if [ $? != 0 ]; then + ifup "$i" + fi + done +fi + +exit 0 + |