SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have some shell script code where I would like to suspend, hibernate or put to sleep then on a condition have it wake up and continue. This point where I want to do this is within a designed infinite while loop which sleeps 1 second at the end of each loop. Ideally I would like to have the condition of a driver wake the slumbering code. The condition I am looking at is whether or not an interface ppp0, eth0, etc. is active.
Any suggestions for doing this? I could use "wait" to put it to sleep but haven't seen anything that could be used to wake it up like I want.
Using "sleep" could miss an event so this is not useable here.
The same problem exists whether foreground or background.
My idea was that your script would *check* if the event requiring further action had occurred; i.e., according to the OP if interface eth0 was active; if eth0 was not active, the script would sleep for a second, then check again, and keep looping that way.
Maybe it'd be more helpful if you'd say what you're trying to do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.