HOUR=$(date "+%H") if [ "$SPEED" -le 7000 ] && [ "$HOUR" -eq 01 -o "$HOUR" -eq 02 -o "$HOUR" -eq 03 -o "$HOUR" -eq 04 -o "$HOUR" -eq 05 -o "$HOUR" -eq 06 -o "$HOUR" -eq 07 -o "$HOUR" -eq 08 ]; then blah blah blah
HOUR=$(date "+%H") if [ "$SPEED" -le 7000 ] && [ "$HOUR" -eq 01,02,03,04,05,06,07,08 ]; then
"$HOUR" -le 8
I hope it doesn't need to get any more complex.
Basically I want the script to only reboot the router at night, rather than have it loop when people are in the bathroom.
I shouldn't have to be making this (fail) :@ :@ :@
Got a bash script for checking the speed of my router and rebooting when necessary. It is now time dependant but the line I've used is awful.
Basically I want the script to only reboot the router at night, rather than have it loop when people are in the bathroom.
So if I've understood this correctly, you want your router to check its speed and reboot only if someone's not using the connection? Dumb question: why not just get it to (check and) reboot once before a new user session?
Eh? New user session?
There's always things connected to it using the connection. So it's not really a time with no activity, just much less. And detecting a "new user session" can't be easy.
Eh? New user session?
When real people, who care about d/l speed are using the connection.
And detecting a "new user session" can't be easy.
Au contraire, it doesn't have to be detected, it's the time when real people (if you have any in Manchester) start to use the connection. Innit?
That varies far too much.
And using it at a slower sync for browsing is better than waiting for it to reboot. Also, if I was to reboot just before I get back from work there's a good chance I'll go to the loo when I get home, fucking the whole thing up.
I'm sticking to early hours reboots and manual ones if I'm really bothered. Since 4mbps is actually fine for casual browsing, just not streaming and torrenting stuff quickly.