mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
Update v-activate-rocket-nginx
This commit is contained in:
parent
7c9dfd4c05
commit
a997f6f59c
1 changed files with 23 additions and 15 deletions
|
@ -104,23 +104,31 @@ fi
|
||||||
|
|
||||||
|
|
||||||
# Adding cron job
|
# Adding cron job
|
||||||
echo "Adding cron job..."
|
# Check if a cron job already exists for any of the specified PHP-FPM versions
|
||||||
|
existing_cron=$(crontab -l -u $user | grep "*/15.*wp-cron.php.*php[5-8].[6-9]\|8.[0-2]" | grep -v "grep")
|
||||||
TPL=$(/usr/local/vesta/bin/v-list-web-domain $user $domain shell | grep 'TEMPLATE:' | awk '{print $2}')
|
|
||||||
if [[ $TPL == "PHP-FPM-"* ]]; then
|
if [ ! -z "$existing_cron" ]; then
|
||||||
fpm_tpl_ver=${TPL:8:2}
|
echo "There is already a cron job added for user $user and domain $domain."
|
||||||
fpm_ver="${TPL:8:1}.${TPL:9:1}"
|
else
|
||||||
|
echo "Adding cron job..."
|
||||||
|
|
||||||
|
# Add the cron job
|
||||||
|
TPL=$(/usr/local/vesta/bin/v-list-web-domain $user $domain shell | grep 'TEMPLATE:' | awk '{print $2}')
|
||||||
|
if [[ $TPL == "PHP-FPM-"* ]]; then
|
||||||
|
fpm_tpl_ver=${TPL:8:2}
|
||||||
|
fpm_ver="${TPL:8:1}.${TPL:9:1}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch /home/$user/web/$domain/cron.log
|
||||||
|
chown $user:$user /home/$user/web/$domain/cron.log
|
||||||
|
|
||||||
|
case $fpm_ver in
|
||||||
|
5.6 | 7.0 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 | 8.1 | 8.2)
|
||||||
|
/usr/local/vesta/bin/v-add-cron-job "$user" "*/15" "*" "*" "*" "*" "cd /home/$user/web/$domain/public_html; /usr/bin/php$fpm_ver wp-cron.php >/home/$user/web/$domain/cron.log 2>&1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
touch /home/$user/web/$domain/cron.log
|
|
||||||
chown $user:$user /home/$user/web/$domain/cron.log
|
|
||||||
|
|
||||||
case $fpm_ver in
|
|
||||||
5.6 | 7.0 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 | 8.1 | 8.2)
|
|
||||||
/usr/local/vesta/bin/v-add-cron-job "$user" "*/15" "*" "*" "*" "*" "cd /home/$user/web/$domain/public_html; /usr/bin/php$fpm_ver wp-cron.php >/home/$user/web/$domain/cron.log 2>&1"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Vesta #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue