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.
Here's the line
Bash code:
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
There is surely a nicer way to do the hour thing rather then using "-o" for each hour.
Something like this (but obviously something that actually works)
Bash code:
HOUR=$(date "+%H")
if [ "$SPEED" -le 7000 ] &&
[ "$HOUR" -eq 01,02,03,04,05,06,07,08 ]; then
Ideas on a postcard.