4 use CGI
::Carp
qw(fatalsToBrowser);
5 print header
() . start_html
(), p
;
6 print 'Stop maintenance: $Id: prevent-maintenance.pl,v 1.1 2003/11/16 21:35:51 as Exp $', "\n";
7 if (not param
('dir')) {
9 '$DataDir: ', textfield
('dir', '/tmp/oddmuse'),
10 p
, submit
('Ok'), "\n", end_form
;
11 } elsif (param
('dir') and not param
('sure')) {
12 print start_form
, hidden
('sure', 'yes'), hidden
('dir', param
('dir')),
13 '$DataDir: ', param
('dir'),
14 p
, submit
('Confirm'), "\n", end_form
;
16 $time = (time) + 28 * 24 * 3600; # four weeks
17 $file = param
('dir') . "/maintain";
18 open(F
, ">$file") or die "Unable to create maintenance file";
19 print F
"Preventing maintenance until " . gmtime($time);
21 utime $time, $time, $file;
22 print pre
(`ls -l $file`);