No, it can be the same irule.
when RULE_INIT {
array set static::timerange {
Sunday {}
Monday {}
Tuesday {"02:00" "14:00"}
Wednesday {}
Thursday {}
Friday {}
Saturday {}
}
}
when HTTP_REQUEST {
if { ([string tolower [HTTP::uri]] contains "/contractor/") } {
set now [clock seconds]
set current_day [clock format $now -format {%A}]
set start [lindex $static::timerange($current_day) 0]
set end [lindex $static::timerange($current_day) 1]
if {($start ne "") && ($end ne "") && ($now >= [clock scan $start]) && ($now < [clock scan $end])} {
set denied 0
} else {set denied 1}
unset start end
} else {set denied 0}
if { $denied } {
HTTP::respond 200 content "Not Authorised! Contact AdministratorNot Authorised! Contact Administrator..."
} elseif { [active_members [LB::server pool]] == 0 } {
HTTP::respond 200 content "<content>"
unset denied
} else {pool POOL_443}
unset denied
}
Cheers,
Kees