#!/bin/bash

. /usr/share/groovix/global.conf

NETWAIT=$GX_NETWORK_WAIT_TIMEOUT
if [ -z "$NETWAIT" ] ; then
	#default to something longer than failsafe-boot.conf timeout
	# and under almost all circumstances this will end when failsafe-boot.conf timeout ends
        NETWAIT=120
fi
echo -n "waiting for a network connection..."
while [ ! -e /var/run/groovix/network-ready ] && [ "$NETWAIT" -gt 0 ] ; do
        sleep 1;
        let NETWAIT=NETWAIT-1
        echo -n ".";
done
if [ "$NETWAIT" -eq 0 ] ; then
        echo "timed out."
else
        echo "done."
fi

