better check of the crontabs and nginx as final command

This commit is contained in:
Diego Lendoiro 2017-09-14 16:26:14 +02:00
parent 6bc808fde0
commit 5f5e97e516
1 changed files with 7 additions and 7 deletions

View File

@ -166,11 +166,14 @@ email_cron_job() {
mkdir -p $cron_task_dir
echo "* * * * * run-parts $cron_task_dir" >> $root_crontab
if ! grep $cron_task_dir $root_crontab > /dev/null; then
echo "* * * * * run-parts $cron_task_dir" >> $root_crontab
fi
echo "#!/bin/sh" > $cron_task
chmod +x $cron_task
echo "su -c \"$process_email\" -ls /bin/bash nginx" >> $cron_task
crond -f -c /etc/crontabs &
}
@ -202,16 +205,13 @@ if [ ! -f $ssl_key ] && [ ! -L $ssl_key ] && \
gen_ssl_cert
fi
if ! grep run-parts /etc/crontabs/root > /dev/null ; then
email_cron_job
fi
php_fpm_setup
install
php-fpm5
nginx -g "pid /tmp/nginx.pid; daemon off;" &
email_cron_job
nginx -g "pid /tmp/nginx.pid; daemon off;"
crond -f -c /etc/crontabs