2017-07-04 13:57:05 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-09-01 18:12:10 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
2017-07-04 13:57:05 +02:00
|
|
|
|
2019-04-18 05:04:18 +02:00
|
|
|
#=================================================
|
2021-08-22 12:42:38 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2019-04-18 05:04:18 +02:00
|
|
|
#=================================================
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_script_progression "Restoring $app main directory..."
|
2021-08-22 12:42:38 +02:00
|
|
|
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_restore "$install_dir"
|
2019-04-18 05:04:18 +02:00
|
|
|
|
2023-06-07 22:28:49 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
2024-07-01 11:30:11 +02:00
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2019-04-18 05:04:18 +02:00
|
|
|
|
2024-06-17 22:22:44 +02:00
|
|
|
#=================================================
|
|
|
|
# RESTORE THE MYSQL DATABASE
|
|
|
|
#=================================================
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_script_progression "Restoring the MySQL database..."
|
2024-06-17 22:22:44 +02:00
|
|
|
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_mysql_db_shell < ./db.sql
|
2024-06-17 22:22:44 +02:00
|
|
|
|
2019-04-06 20:29:15 +02:00
|
|
|
#=================================================
|
|
|
|
# RESTORE THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_script_progression "Restoring the PHP-FPM configuration..."
|
2019-04-06 20:29:15 +02:00
|
|
|
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
2019-04-06 20:29:15 +02:00
|
|
|
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2023-08-14 21:54:24 +02:00
|
|
|
|
2018-09-01 18:12:10 +02:00
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX AND PHP-FPM
|
|
|
|
#=================================================
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
|
2017-07-04 13:57:05 +02:00
|
|
|
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_systemctl --service="php${php_version}-fpm" --action=reload
|
|
|
|
ynh_systemctl --service=nginx --action=reload
|
2019-04-06 20:29:15 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 09:20:53 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|