Handle hostnames with upper-case letters
[webmin.git] / cfengine / run.cgi
1 #!/usr/local/bin/perl
2 # run.cgi
3 # Run cfengine on this host
4
5 require './cfengine-lib.pl';
6 &ReadParse();
7 &ui_print_unbuffered_header(undef, $text{'run_title'}, "");
8
9 # Construct the command
10 $cmd = "$config{'cfengine'} -f $cfengine_conf";
11 $cmd .= " -v" if ($in{'verbose'});
12 $cmd .= " --dry-run" if ($in{'dry'});
13 $cmd .= " -i" if ($in{'noifc'});
14 $cmd .= " -m" if ($in{'nomnt'});
15 $cmd .= " -s" if ($in{'nocmd'});
16 $cmd .= " -t" if ($in{'notidy'});
17 $cmd .= " -X" if ($in{'nolinks'});
18
19 print "<p><b>",&text('run_exec', "<tt>$cmd</tt>"),"</b><br>\n";
20 print "<pre>";
21 $ENV{'CFINPUTS'} = $config{'cfengine_dir'};
22 open(CMD, "$cmd 2>&1 </dev/null |");
23 while(<CMD>) {
24         print &html_escape($_);
25         }
26 close(CMD);
27 &additional_log("exec", undef, $cmd);
28 print "</pre>\n";
29 &webmin_log("run");
30
31 &ui_print_footer("", $text{'index_return'});
32