mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
inc: remove a useless wrapper
This commit is contained in:
parent
241ed34a2c
commit
b6e987dc37
@ -1969,12 +1969,13 @@ function filter_nat_rules_generate() {
|
||||
$natrules .= "\n# Reflection redirects and NAT for 1:1 mappings\n" . $reflection_txt;
|
||||
|
||||
// Check if inetd is running, if not start it. If so, restart it gracefully.
|
||||
$helpers = isvalidproc("inetd");
|
||||
if(file_exists("/var/etc/inetd.conf")) {
|
||||
if(!$helpers)
|
||||
$helpers = is_process_running('inetd');
|
||||
if (file_exists('/var/etc/inetd.conf')) {
|
||||
if (!$helpers) {
|
||||
mwexec("/usr/sbin/inetd -wW -R 0 -a 127.0.0.1 /var/etc/inetd.conf");
|
||||
else
|
||||
} else {
|
||||
sigkillbypid("/var/run/inetd.pid", "HUP");
|
||||
}
|
||||
}
|
||||
|
||||
return $natrules;
|
||||
|
||||
@ -39,17 +39,13 @@ function isvalidpid($pidfile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_process_running($process) {
|
||||
$output = "";
|
||||
exec("/bin/pgrep -anx " . escapeshellarg($process), $output, $retval);
|
||||
function is_process_running($process)
|
||||
{
|
||||
exec('/bin/pgrep -anx ' . escapeshellarg($process), $output, $retval);
|
||||
|
||||
return (intval($retval) == 0);
|
||||
}
|
||||
|
||||
function isvalidproc($proc) {
|
||||
return is_process_running($proc);
|
||||
}
|
||||
|
||||
/* sigkill a process by pid file */
|
||||
/* return 1 for success and 0 for a failure */
|
||||
function sigkillbypid($pidfile, $sig) {
|
||||
@ -62,7 +58,7 @@ function sigkillbypid($pidfile, $sig) {
|
||||
/* kill a process by name */
|
||||
function killbyname($procname)
|
||||
{
|
||||
if (isvalidproc($procname)) {
|
||||
if (is_process_running($procname)) {
|
||||
mwexec('/usr/bin/killall ' . escapeshellarg($procname));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user