Handle hostnames with upper-case letters
[webmin.git] / ipsec / up.cgi
1 #!/usr/local/bin/perl
2 # up.cgi
3 # Attempt to open a connection that was not started automatically
4
5 require './ipsec-lib.pl';
6 &ReadParse();
7 $| = 1;
8 $theme_no_table++;
9 &ui_print_header(undef, $text{'up_title'}, "");
10
11 # Try to connect
12 $cmd = "$config{'ipsec'} auto --up '$in{'conn'}'";
13 print "<b>",&text('up_cmd', "<tt>$cmd</tt>"),"</b>\n";
14 print "<pre>";
15 &foreign_require("proc", "proc-lib.pl");
16 &proc::safe_process_exec_logged($cmd, 0, 0, STDOUT, undef, 1);
17 print "</pre>\n";
18
19 # Save connection in config
20 &lock_file("$module_config_directory/config");
21 $config{'conn'} = $in{'conn'};
22 &write_file("$module_config_directory/config", \%config);
23 &unlock_file("$module_config_directory/config");
24 if (!$?) {
25         &webmin_log("up", undef, $in{'conn'});
26         }
27
28 &ui_print_footer("", $text{'index_return'});
29