Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
b6e987dc
Commit
b6e987dc
authored
Apr 01, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: remove a useless wrapper
parent
241ed34a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
filter.inc
src/etc/inc/filter.inc
+5
-4
util.inc
src/etc/inc/util.inc
+4
-8
No files found.
src/etc/inc/filter.inc
View file @
b6e987dc
...
...
@@ -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
=
is
validproc
(
"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
;
...
...
src/etc/inc/util.inc
View file @
b6e987dc
...
...
@@ -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
(
is
validproc
(
$procname
))
{
if
(
is
_process_running
(
$procname
))
{
mwexec
(
'/usr/bin/killall '
.
escapeshellarg
(
$procname
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment