Aaron,
With a little tweaking to get the "0"s to pass correctly to the variables, the following is working correctly now for all times that I have attempted, including midnight to 1:00am.
when HTTP_REQUEST {
Change the following to set schedule
set maintenance_start_time "200";
set maintenance_end_time "615";
set maintenance_day "Saturday";
Get time in seconds, formatted as day of week (%A) hour (%k) minute (%M)
Use scan to save output as $cur_day $cur_hour $cur_minute
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}
log local0. "\$cur_day: $cur_day, \$cur_hour: $cur_hour, \$cur_minute: $cur_minute, \$cur_time: $cur_time"
if { ($cur_day eq $maintenance_day) &&
($cur_time >= $maintenance_start_time) &&
($cur_time <= $maintenance_end_time) } {
HTTP::respond 200 content " Site Maintenance
text=800517>
Site is temporarily unavailable.
Site will be available again at 6:15am.
We are sorry for any inconvenience. "
}
}
Thanks very much to all who responded.