Handle hostnames with upper-case letters
[webmin.git] / adsl-client / stop.cgi
1 #!/usr/local/bin/perl
2 # stop.cgi
3 # Shut down the ADSL connection
4
5 require './adsl-client-lib.pl';
6 &ReadParse();
7 &error_setup($text{'stop_err'});
8
9 $out = &backquote_logged("$config{'stop_cmd'} 2>&1");
10 if ($?) {
11         &error("<pre>$out</pre>");
12         }
13 else {
14         &ui_print_header(undef, $text{'stop_title'}, "");
15
16         # Wait for it to really stop
17         for($i=0; $i<20 && $ip; $i++) {
18                 sleep(1);
19                 ($dev, $ip) = &get_adsl_ip();
20                 }
21         if ($ip) {
22                 print "<p>$text{'stop_failed'}<p>\n";
23                 }
24         else {
25                 print "<p>$text{'stop_ok'}<p>\n";
26                 }
27
28         &ui_print_footer("", $text{'index_return'});
29         }
30 &webmin_log("stop");
31