Browse Source

Force upgrade with a cron

pull/63/head
Maniack Crudelis 7 years ago
parent
commit
7e4808ebc3
  1. 6
      scripts/backup
  2. 8
      scripts/change_url
  3. 7
      scripts/install
  4. 6
      scripts/remove
  5. 6
      scripts/restore
  6. 7
      scripts/upgrade

6
scripts/backup

@ -68,6 +68,12 @@ ynh_script_progression --message="Backup fail2ban configuration"
ynh_backup "/etc/fail2ban/jail.d/$app.conf" ynh_backup "/etc/fail2ban/jail.d/$app.conf"
ynh_backup "/etc/fail2ban/filter.d/$app.conf" ynh_backup "/etc/fail2ban/filter.d/$app.conf"
#=================================================
# BACKUP CRON
#=================================================
ynh_backup "/etc/cron.d/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

8
scripts/change_url

@ -124,6 +124,14 @@ fi
ynh_mysql_execute_as_root "UPDATE wp_options SET option_value='$new_domain$new_path' WHERE option_name='siteurl'" $app ynh_mysql_execute_as_root "UPDATE wp_options SET option_value='$new_domain$new_path' WHERE option_name='siteurl'" $app
ynh_mysql_execute_as_root "UPDATE wp_options SET option_value='$new_domain$new_path' WHERE option_name='home'" $app ynh_mysql_execute_as_root "UPDATE wp_options SET option_value='$new_domain$new_path' WHERE option_name='home'" $app
#=================================================
# UPDATE THE CRON
#=================================================
ynh_replace_string "$old_domain$old_path" "$new_domain$new_path"
echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal wordpress cron.
0 3 * * * root wget -q -O - https:///wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================

7
scripts/install

@ -228,6 +228,13 @@ $wpcli_alias plugin activate wp-fail2ban $plugin_network
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/wp-config.php" ynh_store_file_checksum "$final_path/wp-config.php"
#=================================================
# CREATE A CRON TASK FOR AUTOMATIC UPDATE
#=================================================
echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal wordpress cron.
0 3 * * * root wget -q -O - https://$domain$path_url/wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================

6
scripts/remove

@ -69,6 +69,12 @@ ynh_script_progression --message="Remove fail2ban configuration" --weight=8
# Remove the dedicated fail2ban config # Remove the dedicated fail2ban config
ynh_remove_fail2ban_config ynh_remove_fail2ban_config
#=================================================
# REMOVE THE CRON
#=================================================
ynh_secure_remove /etc/cron.d/$app
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================

6
scripts/restore

@ -103,6 +103,12 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
# RESTORE THE CRON
#=================================================
ynh_restore_file "/etc/cron.d/$app"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================

7
scripts/upgrade

@ -200,6 +200,13 @@ $wpcli_alias plugin is-installed http-authentication && $wpcli_alias plugin deac
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum "$final_path/wp-config.php" ynh_store_file_checksum "$final_path/wp-config.php"
#=================================================
# CREATE A CRON TASK FOR AUTOMATIC UPDATE
#=================================================
echo "# Reach everyday wp-cron.php?doing_wp_cron to trig the internal wordpress cron.
0 3 * * * root wget -q -O - https://$domain$path_url/wp-cron.php?doing_wp_cron >/dev/null 2>&1" > /etc/cron.d/$app
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================

Loading…
Cancel
Save