Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
lolo888
ISPConfig 3
Commits
5d54be81
Commit
5d54be81
authored
Aug 20, 2007
by
pedro_morgan
Browse files
Tidy up theispconfig install function
parent
76b6b673
Changes
1
Hide whitespace changes
Inline
Side-by-side
install/lib/installer_base.lib.php
View file @
5d54be81
...
...
@@ -630,41 +630,37 @@ class installer_base {
}
public
function
install_crontab
()
{
global
$conf
;
// Root Crontab
exec
(
"crontab -u root -l > crontab.txt"
);
{
//* Root Crontab
exec
(
'crontab -u root -l > crontab.txt'
);
$existing_root_cron_jobs
=
file
(
'crontab.txt'
);
$root_cron_jobs
=
array
(
'* * * * * /usr/bin/php -q /usr/local/ispconfig/server/server.php &> /dev/null'
);
foreach
(
$root_cron_jobs
as
$cron_job
)
{
if
(
!
in_array
(
$cron_job
.
"
\n
"
,
$existing_root_cron_jobs
))
{
if
(
!
in_array
(
$cron_job
.
"
\n
"
,
$existing_root_cron_jobs
))
{
$existing_root_cron_jobs
[]
=
$cron_job
.
"
\n
"
;
}
}
file_put_contents
(
'crontab.txt'
,
$existing_root_cron_jobs
);
exec
(
"
crontab -u root crontab.txt &> /dev/null
"
);
file_put_contents
(
'crontab.txt'
,
$existing_root_cron_jobs
);
exec
(
'
crontab -u root crontab.txt &> /dev/null
'
);
unlink
(
'crontab.txt'
);
// Getmail crontab
exec
(
"crontab -u getmail -l > crontab.txt"
);
//* Getmail crontab
$cf
=
$this
->
conf
[
'dist'
][
'getmail'
];
exec
(
'crontab -u getmail -l > crontab.txt'
);
$existing_cron_jobs
=
file
(
'crontab.txt'
);
$cron_jobs
=
array
(
'*/5 * * * * '
.
$c
onf
[
"dist"
][
"getmail"
][
"
program
"
]
.
' -g '
.
$c
onf
[
"dist"
][
"getmail"
][
"
config_dir
"
]
.
' -r '
.
$c
onf
[
"dist"
][
"getmail"
][
"
config_dir
"
]
.
'/*.conf &> /dev/null'
);
$cron_jobs
=
array
(
'*/5 * * * * '
.
$c
f
[
'
program
'
]
.
' -g '
.
$c
f
[
'
config_dir
'
]
.
' -r '
.
$c
f
[
'
config_dir
'
]
.
'/*.conf &> /dev/null'
);
foreach
(
$cron_jobs
as
$cron_job
)
{
if
(
!
in_array
(
$cron_job
.
"
\n
"
,
$existing_cron_jobs
))
{
if
(
!
in_array
(
$cron_job
.
"
\n
"
,
$existing_cron_jobs
))
{
$existing_cron_jobs
[]
=
$cron_job
.
"
\n
"
;
}
}
file_put_contents
(
'crontab.txt'
,
$existing_cron_jobs
);
exec
(
"
crontab -u getmail crontab.txt &> /dev/null
"
);
file_put_contents
(
'crontab.txt'
,
$existing_cron_jobs
);
exec
(
'
crontab -u getmail crontab.txt &> /dev/null
'
);
unlink
(
'crontab.txt'
);
}
}
?>
?>
\ No newline at end of file
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