Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lolo888
ISPConfig 3
Commits
8a072e70
Commit
8a072e70
authored
Jan 20, 2010
by
wyrie
Browse files
Fixed: FS#1034 - Gentoo portage sync too frequent
parent
6d80f556
Changes
1
Show whitespace changes
Inline
Side-by-side
server/mods-available/monitor_core_module.inc.php
View file @
8a072e70
...
...
@@ -533,7 +533,27 @@ class monitor_core_module {
/*
* first update the portage tree
*/
// In keeping with gentoo's rsync policy, don't update to frequently (every four hours - taken from http://www.gentoo.org/doc/en/source_mirrors.xml)
$do_update
=
true
;
if
(
file_exists
(
'/usr/portage/metadata/timestamp.chk'
))
{
$datetime
=
file_get_contents
(
'/usr/portage/metadata/timestamp.chk'
);
$datetime
=
trim
(
$datetime
);
$dstamp
=
strtotime
(
$datetime
);
if
(
$dstamp
)
{
$checkat
=
$dstamp
+
14400
;
// + 4hours
if
(
mktime
()
<
$checkat
)
{
$do_update
=
false
;
}
}
}
if
(
$do_update
)
{
shell_exec
(
'emerge --sync --quiet'
);
}
/*
* Then test the upgrade.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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