summaryrefslogtreecommitdiff
path: root/initscript
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-06-10 20:48:44 +0000
committerDan Williams <dcbw@redhat.com>2008-06-10 20:48:44 +0000
commit0e1c398c663c5f9d4c2916cedc274f6316bd7701 (patch)
tree0c0a4239955843751f8b4f20beb8e9ec7657a05f /initscript
parent69adda9b659075a8a0cb89c009db6615be13645a (diff)
downloadNetworkManager-0e1c398c663c5f9d4c2916cedc274f6316bd7701.tar.gz
Add bits to optionally block startup until a conneciton is made
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3744 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'initscript')
-rw-r--r--initscript/Mandriva/networkmanager.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/initscript/Mandriva/networkmanager.in b/initscript/Mandriva/networkmanager.in
index 74580dec95..dac14e72ef 100644
--- a/initscript/Mandriva/networkmanager.in
+++ b/initscript/Mandriva/networkmanager.in
@@ -31,6 +31,9 @@ NETWORKMANAGER_BIN=${sbindir}/NetworkManager
# Source function library.
. /etc/rc.d/init.d/functions
+# Source network configuration
+. /etc/sysconfig/network
+
# so we can rearrange this easily
processname=NetworkManager
servicename=NetworkManager
@@ -51,6 +54,14 @@ start()
daemon --check $servicename $processname --pid-file=$pidfile
RETVAL=$?
echo
+ if [ -n "${NETWORKWAIT}" ]; then
+ [ -z "${LINKDELAY}" ] && LINKDELAY=10
+ echo -n $"Waiting for network..."
+ nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30
+ [ "$?" = "0" ] && success "network startup" || failure "network startup"
+ echo
+ [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY}
+ fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
}