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 ...
hoolio
Cirrostratus
Mar 11, 2011Hi Johan,
Thanks for posting your update.
You could make that a bit more efficient by setting the start and end variables in RULE_INIT as static variables (in v10). You could also save a few cycles by wrapping the expr operands in curly braces:
set start [expr (${start_month}000000 + ${start_day}0000 + ${start_hour}00 + ${start_minute} )]
set end [expr (${end_month}000000 + ${end_day}0000 + ${end_hour}00 + ${end_minute} )]
->
set start [expr {${start_month}000000 + ${start_day}0000 + ${start_hour}00 + ${start_minute} }]
set end [expr {${end_month}000000 + ${end_day}0000 + ${end_hour}00 + ${end_minute} }]
Also, if you're on 10.x, it would be more efficient to replace matchclass with 'class match'.
Aaron
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