irule time based to select pool
Hi I need to configure an irule based in time for select one pool, I need to configure the rule start at 7 pm and finish at 2 am of the next day each day, I configure the next irule
when RULE_INIT {
set static::start [clock scan "7:00 pm"] set static::end [clock scan "2:00 am"] } when CLIENT_ACCEPTED {
Get the current time in seconds since the Unix epoch of 0-0-1970 set now [clock seconds] Check if the current time is between the start and end times if {$now > $static::start and $now < $static::end}{ pool pool_gw log local0. " pool navegacion" } }
If I change the start time for example at 10 am and the end time 11 am all work the problem is because the start time begin one day and finish the other day.
Do you have any idea to solve this?