Handle hostnames with upper-case letters
[webmin.git] / pptp-client / bootup.cgi
1 #!/usr/local/bin/perl
2 # bootup.cgi
3 # Create, enable or disable PPTP startup at boot time
4
5 require './pptp-client-lib.pl';
6 &foreign_require("init", "init-lib.pl");
7 &ReadParse();
8
9 $start_cmd = "$module_config_directory/start.pl";
10 $stop_cmd = "$module_config_directory/stop.pl";
11
12 if ($in{'tunnel'}) {
13         # Create start and stop wrapper scripts
14         &foreign_require("cron", "cron-lib.pl");
15         &cron::create_wrapper($start_cmd, $module_name, "start.pl");
16         &cron::create_wrapper($stop_cmd, $module_name, "stop.pl");
17
18         # Enable starting at boot
19         &init::enable_at_boot($module_name,
20                               "Startup or shutdown PPTP connection",
21                               $start_cmd, $stop_cmd);
22         $config{'boot'} = $in{'tunnel'};
23         }
24 else {
25         # Disable starting at boot
26         &init::disable_at_boot($module_name);
27         delete($config{'boot'});
28         }
29
30 # Save setting
31 &save_module_config();
32
33 &redirect("");
34