Shiraz
Apr 28, 2016Altostratus
Irule to block access of VS on specific days
Dears,
I am able to restrict the access to Virtual Server by providing the static time by using the below irule. However, I also want to use this irule to restrict the access on weekends.
when RULE_INIT {
set current_day [clock format [clock seconds] -format {%a} ]
set static::START_OFF_TIME "05:30 AM"
set static::END_OFF_TIME "01:00 PM"
}
when HTTP_REQUEST {
set start_off_time [clock scan $static::START_OFF_TIME]
set end_off_time [clock scan $static::END_OFF_TIME]
set now [clock seconds]
if { ( [expr $now > $start_off_time] ) and ( [expr $now < $end_off_time] ) } {
HTTP::respond 200 content "Maintenance ModeMaintenance mode..."
}
}