MOON
Server: Apache
System: Linux cl1170g 4.19.62-mod-std-ipv6-64-rescue #828825 SMP Tue Jul 30 13:54:49 UTC 2019 x86_64
User: wh0f20bb (1057)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //proc/thread-self/root/root/webmin-1.881/pptp-client/bootup.cgi
#!/usr/bin/perl
# bootup.cgi
# Create, enable or disable PPTP startup at boot time

require './pptp-client-lib.pl';
&foreign_require("init", "init-lib.pl");
&ReadParse();

$start_cmd = "$module_config_directory/start.pl";
$stop_cmd = "$module_config_directory/stop.pl";

if ($in{'tunnel'}) {
	# Create start and stop wrapper scripts
	&foreign_require("cron", "cron-lib.pl");
	&cron::create_wrapper($start_cmd, $module_name, "start.pl");
	&cron::create_wrapper($stop_cmd, $module_name, "stop.pl");

	# Enable starting at boot
	&init::enable_at_boot($module_name,
			      "Startup or shutdown PPTP connection",
			      $start_cmd, $stop_cmd, undef, { 'fork' => 1 });
	$config{'boot'} = $in{'tunnel'};
	}
else {
	# Disable starting at boot
	&init::disable_at_boot($module_name);
	delete($config{'boot'});
	}

# Save setting
&save_module_config();

&redirect("");