Good day! Is there any way to include a timer (timestamp?or whatever term it is) in a script using bash? Like for instance; every 60 seconds, a specific function checks if the internet is down, if it is, then it connects to the wifi device instead and vice versa. In short, the program checks the internet connection from time to time.
Any suggestions/answers will be much appreciated. =)
Blunt version
Using the sleep itself as loop condition allows you to break out of the loop by killing the sleep (i.e. if it’s a foreground process, ctrl-c will do).
If we’re talking minutes or hours intervals, cron will probably do a better job, as Montecristo pointed out.