File tree Expand file tree Collapse file tree 4 files changed +30
-8
lines changed
Expand file tree Collapse file tree 4 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -758,6 +758,9 @@ public function install_ispconfig()
758758 if (!is_dir ('/var/log/ispconfig ' )) mkdir ('/var/log/ispconfig ' );
759759 if (!is_file ('/var/log/ispconfig/ispconfig.log ' )) exec ('touch /var/log/ispconfig/ispconfig.log ' );
760760
761+ exec ('chown getmail /usr/local/ispconfig/server/scripts/run-getmail.sh ' );
762+ exec ('chmod 744 /usr/local/ispconfig/server/scripts/run-getmail.sh ' );
763+
761764
762765 }
763766
@@ -817,11 +820,13 @@ public function install_crontab()
817820 exec ('crontab -u getmail -l > crontab.txt ' );
818821 $ existing_cron_jobs = file ('crontab.txt ' );
819822
820- $ cron_jobs = array ('*/5 * * * * ' .$ cf ['program ' ].' -n -g ' .$ cf ['config_dir ' ].' -r ' .$ cf ['config_dir ' ].'/*.conf &> /dev/null ' );
821-
823+ $ cron_jobs = array (
824+ '*/5 * * * * /usr/local/ispconfig/server/scripts/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log '
825+ );
826+
822827 // remove existing ispconfig cronjobs, in case the syntax has changed
823828 foreach ($ cron_jobs as $ key => $ val ) {
824- if (stristr ($ val ,$ cf [ ' program ' ] )) unset($ existing_cron_jobs [$ key ]);
829+ if (stristr ($ val ,' getmail ' )) unset($ existing_cron_jobs [$ key ]);
825830 }
826831
827832 foreach ($ cron_jobs as $ cron_job ) {
Original file line number Diff line number Diff line change @@ -776,6 +776,9 @@ public function install_ispconfig()
776776 if (!is_dir ('/var/log/ispconfig ' )) mkdir ('/var/log/ispconfig ' );
777777 if (!is_file ('/var/log/ispconfig/ispconfig.log ' )) exec ('touch /var/log/ispconfig/ispconfig.log ' );
778778
779+ exec ('chown getmail /usr/local/ispconfig/server/scripts/run-getmail.sh ' );
780+ exec ('chmod 744 /usr/local/ispconfig/server/scripts/run-getmail.sh ' );
781+
779782
780783 }
781784
@@ -835,11 +838,13 @@ public function install_crontab()
835838 exec ('crontab -u getmail -l > crontab.txt ' );
836839 $ existing_cron_jobs = file ('crontab.txt ' );
837840
838- $ cron_jobs = array ('*/5 * * * * ' .$ cf ['program ' ].' -n -g ' .$ cf ['config_dir ' ].' -r ' .$ cf ['config_dir ' ].'/*.conf &> /dev/null ' );
839-
841+ $ cron_jobs = array (
842+ '*/5 * * * * /usr/local/ispconfig/server/scripts/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log '
843+ );
844+
840845 // remove existing ispconfig cronjobs, in case the syntax has changed
841846 foreach ($ cron_jobs as $ key => $ val ) {
842- if (stristr ($ val ,$ cf [ ' program ' ] )) unset($ existing_cron_jobs [$ key ]);
847+ if (stristr ($ val ,' getmail ' )) unset($ existing_cron_jobs [$ key ]);
843848 }
844849
845850 foreach ($ cron_jobs as $ cron_job ) {
Original file line number Diff line number Diff line change @@ -1043,6 +1043,9 @@ public function install_ispconfig()
10431043 if (!is_dir ('/var/log/ispconfig ' )) mkdir ('/var/log/ispconfig ' );
10441044 if (!is_file ('/var/log/ispconfig/ispconfig.log ' )) exec ('touch /var/log/ispconfig/ispconfig.log ' );
10451045
1046+ exec ('chown getmail /usr/local/ispconfig/server/scripts/run-getmail.sh ' );
1047+ exec ('chmod 744 /usr/local/ispconfig/server/scripts/run-getmail.sh ' );
1048+
10461049
10471050 }
10481051
@@ -1103,12 +1106,12 @@ public function install_crontab()
11031106 $ existing_cron_jobs = file ('crontab.txt ' );
11041107
11051108 $ cron_jobs = array (
1106- '*/5 * * * * ' . $ cf [ ' program ' ]. ' -n -g ' . $ cf [ ' config_dir ' ]. ' -r ' . $ cf [ ' config_dir ' ]. ' /*.conf > /dev/null 2>> /var/log/ispconfig/cron.log '
1109+ '*/5 * * * * /usr/local/ispconfig/server/scripts/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log '
11071110 );
11081111
11091112 // remove existing ispconfig cronjobs, in case the syntax has changed
11101113 foreach ($ cron_jobs as $ key => $ val ) {
1111- if (stristr ($ val ,$ cf [ ' program ' ] )) unset($ existing_cron_jobs [$ key ]);
1114+ if (stristr ($ val ,' getmail ' )) unset($ existing_cron_jobs [$ key ]);
11121115 }
11131116
11141117 foreach ($ cron_jobs as $ cron_job ) {
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+ cd /etc/getmail
4+ rcfiles=" "
5+ for file in * .conf ; do
6+ rcfiles=" $rcfiles -r $file "
7+ done
8+ # echo $rcfiles
9+ exec /usr/bin/getmail -n -v -g /etc/getmail $rcfiles
You can’t perform that action at this time.
0 commit comments