Forum Discussion
Tim_Moomaw_9220
Nimbostratus
Nov 09, 2008Scheduled Maintenance Window
--- Obligatory "I'm new to iRules" ----
I'm trying to create a rule to return a maintenance page every Saturday morning between 0200 and 0600. I have copied a few examples ...
Tim_Moomaw_9220
Nimbostratus
Nov 10, 2008Great idea Aaron! Not quite there yet though. Sorry to be a pest.....
I haven't tried modifying to fix the minutes yet - 1 thing at a time.
%k and %l give the same error.
TCL error: m-window-test HTTP_REQUEST - cant use empty string as operand of * while executing expr {[lindex $l 1] *100}
Current rule:
when HTTP_REQUEST {
Change the following to set schedule
set start_time "200";
set end_time "900";
set day "Monday";
set l [split [clock format [clock seconds] -format {%A %k %M}] " "]
set cur_day [lindex $l 0]
set cur_time [expr [expr {[lindex $l 1] *100}] + [lindex $l 2]]
if { ($cur_day eq $day) &&
($cur_time >= $start_time) &&
($cur_time <= $end_time) } {
HTTP::respond 200 content " Stuff
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects