How to get bash to wait for something to happen?
I have dial-up Internet access. I want to have a script do the following:
>Dialout to get ppp0 up >Once ppp0 is up, run another script This is what I've done: it works, but I don't like much: Code:
#!/bin/bash Thanks- |
Have a look at /etc/ppp/ip-up, pppd launches this script when ppp0 is active
Otherwise as a general question how to make bash wait for an event, I don't know. I use the same solution for different events but you should add sleep 1 in the while loop. |
Put sleep inside your loop. Man sleep.
|
Great work, guys! Sleep is what I asked for, but thanks, nx5000, I think /etc/ppp/ip-up.d is what I should look at. Another brick in the wall.
Cheers~ |
Quote:
Code:
COUNTER=`expr COUNTER + 1` |
All times are GMT -5. The time now is 07:55 PM. |