2020-11-06 21:41:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2021-06-23 11:47:36 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2020-11-06 21:41:02 +01:00
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Restoring the app main directory..."
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_restore "$install_dir"
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-06-19 00:23:43 +02:00
|
|
|
chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym"
|
|
|
|
chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$install_dir/bootstrap/"
|
2021-05-18 15:08:16 +02:00
|
|
|
|
2021-06-23 11:47:36 +02:00
|
|
|
#=================================================
|
2022-08-07 18:40:41 +02:00
|
|
|
# RESTORE THE DATA DIRECTORY
|
2021-06-23 11:47:36 +02:00
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Restoring the data directory..."
|
2021-06-23 11:47:36 +02:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_restore "$data_dir"
|
2021-06-23 11:47:36 +02:00
|
|
|
|
2024-06-19 00:23:43 +02:00
|
|
|
chmod -R 775 "$data_dir"
|
2024-02-13 09:04:46 +01:00
|
|
|
chown -R "$app:www-data" "$data_dir"
|
2024-06-19 00:23:43 +02:00
|
|
|
chgrp "$app" -R "$data_dir/uploads"
|
|
|
|
chmod -R 2775 "$data_dir/uploads"
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-06-19 15:10:40 +02:00
|
|
|
#=================================================
|
|
|
|
# RESTORE THE MYSQL DATABASE
|
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Restoring the MySQL database..."
|
2024-06-19 15:10:40 +02:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_mysql_db_shell < ./db.sql
|
2024-06-19 15:10:40 +02:00
|
|
|
|
2023-12-30 10:52:22 +01:00
|
|
|
#=================================================
|
2024-06-17 13:57:12 +02:00
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
2023-12-30 10:52:22 +01:00
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Restoring system configurations related to $app..."
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2020-11-06 21:41:02 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX AND PHP-FPM
|
|
|
|
#=================================================
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
|
2020-11-06 21:41:02 +01:00
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_systemctl --service="php$php_version-fpm" --action=reload
|
|
|
|
ynh_systemctl --service=nginx --action=reload
|
2020-11-06 21:41:02 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 21:29:01 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|