Handle hostnames with upper-case letters
[webmin.git] / frox / start.cgi
1 #!/usr/local/bin/perl
2 # Start the Frox proxy
3
4 require './frox-lib.pl';
5 &error_setup($text{'start_err'});
6
7 # Fixed up file on Debian that controls startup script
8 if ($config{'daemon_file'}) {
9         &lock_file($config{'daemon_file'});
10         &read_env_file($config{'daemon_file'}, \%daemon);
11         if ($daemon{'RUN_DAEMON'} ne 'yes') {
12                 $daemon{'RUN_DAEMON'} = 'yes';
13                 &write_env_file($config{'daemon_file'}, \%daemon);
14                 }
15         &unlock_file($config{'daemon_file'});
16         }
17
18 if ($config{'start_cmd'}) {
19         $cmd = $config{'start_cmd'};
20         }
21 else {
22         $cmd = "$config{'frox'} -f $config{'frox_conf'}";
23         }
24 $temp = &transname();
25 $ex = &system_logged("($cmd) >$temp 2>&1 </dev/null");
26 $out = `cat $temp`;
27 unlink($temp);
28 if ($ex || (!$config{'start_cmd'} && $out =~ /\S/) || $out =~ /error/i) {
29         &error("<pre>$out</pre>");
30         }
31 &webmin_log("start");
32 &redirect("");
33