#!/usr/local/bin/perl
# apply.cgi
# Restart inetd and xinetd if used

require './stunnel-lib.pl';

if ($has_inetd) {
	%iconfig = &foreign_config("inetd");
	&system_logged("$iconfig{'restart_command'} >/dev/null 2>&1 </dev/null");
	}
if ($has_xinetd) {
	%xconfig = &foreign_config("xinetd");
	if (open(PID, $xconfig{'pid_file'})) {
		chop($pid = <PID>);
		close(PID);
		kill('USR2', $pid);
		}
	}
&webmin_log("apply");
&redirect("");

