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
9f12e7f7
Commit
9f12e7f7
authored
Apr 26, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cron: flush all, PHP can be tricky #911
parent
ed8c5a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
services.inc
src/etc/inc/services.inc
+15
-13
No files found.
src/etc/inc/services.inc
View file @
9f12e7f7
...
...
@@ -2366,26 +2366,28 @@ function configure_cron()
* This can be safely removed on our final road to 17.1.
*/
if
(
isset
(
$config
[
'cron'
][
'item'
]))
{
foreach
(
$obsoletes
as
$obsolete
)
{
$is_installed
=
false
;
$x
=
0
;
$flush
=
false
;
$index
=
0
;
foreach
(
$config
[
'cron'
][
'item'
]
as
$item
)
{
if
(
strstr
(
$item
[
'command'
],
$obsolete
))
{
$is_installed
=
true
;
break
;
/* PHP retains the index, can iterate all and unset */
foreach
(
$config
[
'cron'
][
'item'
]
as
$item
)
{
foreach
(
$obsoletes
as
$obsolete
)
{
if
(
$item
[
'command'
]
===
$obsolete
)
{
unset
(
$config
[
'cron'
][
'item'
][
$index
]);
$flush
=
true
;
}
$x
++
;
}
if
(
$is_installed
==
true
)
{
unset
(
$config
[
'cron'
][
'item'
][
$x
]);
}
$index
++
;
}
if
(
!
count
(
$config
[
'cron'
][
'item'
]))
{
unset
(
$config
[
'cron'
]);
$flush
=
true
;
}
if
(
$flush
)
{
write_config
(
gettext
(
'Removed obsolete cron jobs'
));
}
write_config
(
gettext
(
'Removed obsolete cron job'
));
}
$autocron
=
array
();
...
...
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