Forum Discussion
SanjayP
Oct 25, 2021Nacreous
I thought of another idea of using event disable command to stop executing other iRules if maintenance page iRule is triggered. Use higher priority for sorry page iRule or move it to the top.
when HTTP_REQUEST priority 100 {
set maintenance_start_time "0000";
set maintenance_end_time "2359";
set maintenance_day "Sunday";
scan [clock format [clock seconds] -format {%A %k %M}] {%s %s %s} cur_day cur_hour cur_minute
set cur_time ${cur_hour}${cur_minute}
if { ($cur_day eq $maintenance_day) &&
($cur_time >= $maintenance_start_time) &&
($cur_time <= $maintenance_end_time) } {
HTTP::respond 200 ifile "/Common/maintenance.html"
event disable all
}
}