summaryrefslogtreecommitdiffstats
path: root/testModule/network.functions
diff options
context:
space:
mode:
authortorben2015-04-09 02:02:46 +0200
committertorben2015-04-09 02:02:46 +0200
commit46dfa60a5faf8c460143beabb9592588abed3902 (patch)
tree3842b8b856741ffb54aa0acad68ea8c85f5ff742 /testModule/network.functions
parentRemove old approach to get internet. Adding command line parsing for (diff)
downloadsystemd-init-46dfa60a5faf8c460143beabb9592588abed3902.tar.gz
systemd-init-46dfa60a5faf8c460143beabb9592588abed3902.tar.xz
systemd-init-46dfa60a5faf8c460143beabb9592588abed3902.zip
Trying convert given pxe ip configuration to dracut compatible one.
Diffstat (limited to 'testModule/network.functions')
-rw-r--r--testModule/network.functions40
1 files changed, 20 insertions, 20 deletions
diff --git a/testModule/network.functions b/testModule/network.functions
index dc5dd52e..89ca5a20 100644
--- a/testModule/network.functions
+++ b/testModule/network.functions
@@ -1,23 +1,23 @@
wait_for_iface() {
-local DEVICE=$1
-local TIMEOUT=10
-echo -n "Waiting for interface $DEVICE: "
-# Some systems don't have operstate. Seems to be hardware dependent
-[ ! -e "/sys/class/net/${DEVICE}/operstate" ] && usleep 10000
-if [ -e "/sys/class/net/${DEVICE}/operstate" ]; then
- while true; do
- # check linkstate
- [ "x$(cat "/sys/class/net/${DEVICE}/operstate")" == "xup" ] && break
- TIMEOUT=$(( $TIMEOUT - 1 )) # don't wait forever, the pcnet iface of vmware will never be "up" although it's working
- [ "$TIMEOUT" -le 0 ] && break
- # else
- echo -n "."
- usleep 500000
- done
-else
- # we really don't have a operstate .. then just wait a sec and hope for the best.
- sleep 1
-fi
-echo ".$(cat "/sys/class/net/${DEVICE}/operstate" 2>/dev/null)"
+ local DEVICE=$1
+ local TIMEOUT=10
+ echo -n "Waiting for interface $DEVICE: "
+ # Some systems don't have operstate. Seems to be hardware dependent
+ [ ! -e "/sys/class/net/${DEVICE}/operstate" ] && usleep 10000
+ if [ -e "/sys/class/net/${DEVICE}/operstate" ]; then
+ while true; do
+ # check linkstate
+ [ "x$(cat "/sys/class/net/${DEVICE}/operstate")" == "xup" ] && break
+ TIMEOUT=$(( $TIMEOUT - 1 )) # don't wait forever, the pcnet iface of vmware will never be "up" although it's working
+ [ "$TIMEOUT" -le 0 ] && break
+ # else
+ echo -n "."
+ usleep 500000
+ done
+ else
+ # we really don't have a operstate .. then just wait a sec and hope for the best.
+ sleep 1
+ fi
+ echo ".$(cat "/sys/class/net/${DEVICE}/operstate" 2>/dev/null)"
}
true