Handle hostnames with upper-case letters
[webmin.git] / ppp-client / init.cgi
1 #!/usr/local/bin/perl
2 # init.cgi
3 # Run wvdialconf to find connected modems
4
5 require './ppp-client-lib.pl';
6 &foreign_require("proc", "proc-lib.pl");
7 &ui_print_unbuffered_header(undef, $text{'init_title'}, "");
8
9 $cmd = "$config{'wvdialconf'} $config{'file'}";
10 print "<p><b>",&text('init_cmd', "<tt>$cmd</tt>"),"</b><br>\n";
11 print "<pre>";
12 &proc::safe_process_exec_logged($cmd, 0, 0, STDOUT, undef, 1);
13 print "</pre>\n";
14 print "<b>$text{'init_done'}</b><p>\n";
15
16 # Re-check the config
17 $conf = &get_config();
18 @modems = map { &device_name($_) } grep { $_ }
19               map { $_->{'values'}->{'modem'} } @$conf;
20 print "<b>";
21 if (@modems > 1) {
22         local $lst = shift(@modems);
23         print &text('init_modems', join(", ", @modems), $lst);
24         }
25 elsif (@modems == 1) {
26         print &text('init_modem', $modems[0]);
27         }
28 else {
29         print $text{'init_none'};
30         }
31 print "</b><p>\n";
32
33 &webmin_log("init");
34 &ui_print_footer("", $text{'index_return'});
35