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
aa19f4b1
Commit
aa19f4b1
authored
May 17, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: refactor return values
Suggested by: @fabianfrz
parent
f759d902
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
services.inc
src/etc/inc/services.inc
+6
-10
No files found.
src/etc/inc/services.inc
View file @
aa19f4b1
...
...
@@ -2937,8 +2937,6 @@ function is_radvd_enabled() {
function
service_control_start
(
$name
,
$extras
)
{
$msg
=
sprintf
(
gettext
(
'%s has been started.'
),
htmlspecialchars
(
$name
));
if
(
!
empty
(
$extras
[
'id'
]))
{
$filter
[
'id'
]
=
$extras
[
'id'
];
}
...
...
@@ -2947,6 +2945,7 @@ function service_control_start($name, $extras)
if
(
!
isset
(
$service
[
'name'
]))
{
return
sprintf
(
gettext
(
"Could not start unknown service `%s'"
),
htmlspecialchars
(
$name
));
}
if
(
isset
(
$service
[
'configd'
][
'start'
]))
{
foreach
(
$service
[
'configd'
][
'start'
]
as
$cmd
)
{
configd_run
(
$cmd
);
...
...
@@ -2966,15 +2965,14 @@ function service_control_start($name, $extras)
mwexec
(
$cmd
);
}
}
else
{
$msg
=
sprintf
(
gettext
(
"Could not start service `%s'"
),
htmlspecialchars
(
$name
));
return
sprintf
(
gettext
(
"Could not start service `%s'"
),
htmlspecialchars
(
$name
));
}
return
$msg
;
return
sprintf
(
gettext
(
'%s has been started.'
),
htmlspecialchars
(
$name
))
;
}
function
service_control_stop
(
$name
,
$extras
)
{
$msg
=
sprintf
(
gettext
(
"%s has been stopped."
),
htmlspecialchars
(
$name
));
$filter
=
array
();
if
(
!
empty
(
$extras
[
'id'
]))
{
...
...
@@ -3005,13 +3003,11 @@ function service_control_stop($name, $extras)
killbyname
(
$service
[
'name'
]);
}
return
$msg
;
return
sprintf
(
gettext
(
"%s has been stopped."
),
htmlspecialchars
(
$name
))
;
}
function
service_control_restart
(
$name
,
$extras
)
{
$msg
=
sprintf
(
gettext
(
"%s has been restarted."
),
htmlspecialchars
(
$name
));
if
(
!
empty
(
$extras
[
'id'
]))
{
$filter
[
'id'
]
=
$extras
[
'id'
];
}
...
...
@@ -3040,8 +3036,8 @@ function service_control_restart($name, $extras)
mwexec
(
$cmd
);
}
}
else
{
$msg
=
sprintf
(
gettext
(
"Could not restart service `%s'"
),
htmlspecialchars
(
$name
));
return
sprintf
(
gettext
(
"Could not restart service `%s'"
),
htmlspecialchars
(
$name
));
}
return
$msg
;
return
sprintf
(
gettext
(
"%s has been restarted."
),
htmlspecialchars
(
$name
))
;
}
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