Great ideas guys, but detecting network is the easy part
The concept I'm having a hard time wrapping my head around is how to efficiently wait/loop while waiting on dhcp. The scripts under rc#.d/ are blocking, so system startup would completely halt while my daemon's init script loops and waits for internet.
It seems that bash has the ability to define a function, and then run it in the background while the defining script exits. In this case I could define a do_it() type function for the start) case to call, and I could background that function such as "do_it&" to allow the init script to exit.
I worked up a 'lil tester script for this backgrounded functions idea, and it seems to work spot on. Only thing is I can not get my stop) case to run a "killall do_it". This last thing would only be relevant during the short time during system startup where I am waiting for DHCP to respond.http://pastebin.com/0wCEEfKt
Think something along these lines would be a good option to do the trick with backgrounding the function called in start) case?