summaryrefslogtreecommitdiff
path: root/initscript/RedHat
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-06-08 23:56:34 +0000
committerDan Williams <dcbw@redhat.com>2008-06-08 23:56:34 +0000
commitd8c3e783ef68d590cc5df80dac515f5ff8d8514e (patch)
tree1637525a7b61be32e40986dc8fbcd724292bbb24 /initscript/RedHat
parenta7f2b61cdf00e90e702cb69f88ec93088c5e9536 (diff)
Allow blocking startup until there's a connection
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3732 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'initscript/RedHat')
-rwxr-xr-xinitscript/RedHat/NetworkManager.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/initscript/RedHat/NetworkManager.in b/initscript/RedHat/NetworkManager.in
index 8725b8d1..4c8637a0 100755
--- a/initscript/RedHat/NetworkManager.in
+++ b/initscript/RedHat/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
@@ -49,6 +52,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
}