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 ...
Nov 14, 2008
As an aside here, I just updated the "iRule Maintenance Windows" tech tip to fix the octal number issue. I did so by removing the math and using string concatenation.
As for your iRule, that looks great. If you want to support 08 or 09 in the morning, you can do so by appending a period after the value
So, this theoretically should work:
if { ([lindex $l 0] eq "Saturday") &&
([lindex $l 1] >= 08.) &&
([lindex $l 1] < 09.) } {
....
I'm not sure if this is the "best" way to do it, but it does seem to work.
Another option would be to use the "format" command on the lindex command values to convert the values to a number with "g". If you go that route, you'll want to remove the leading zero from your comparison
if { ([lindex $l 0] eq "Saturday") &&
([format "%g" [lindex $l 1]] >= 😎 &&
([format "%g" [lindex $l 1]] < 9) } {
....
Lots of ways to go about it. Glad to see it's working for you though!
-Joe
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