2017-03-25 18:31:20 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
2020-12-31 23:19:32 +01:00
|
|
|
# GENERIC START
|
2017-03-25 18:31:20 +01:00
|
|
|
#=================================================
|
2020-12-31 23:19:32 +01:00
|
|
|
# IMPORT GENERIC HELPERS
|
2017-03-25 18:31:20 +01:00
|
|
|
#=================================================
|
|
|
|
|
2020-12-31 23:19:32 +01:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-03-25 18:31:20 +01:00
|
|
|
#=================================================
|
2021-06-06 09:07:27 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2017-03-25 18:31:20 +01:00
|
|
|
#=================================================
|
2021-06-06 09:07:27 +02:00
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=2
|
2017-03-25 18:31:20 +01:00
|
|
|
|
2023-03-07 22:34:15 +01:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2022-01-12 22:04:24 +01:00
|
|
|
|
2023-03-07 22:34:15 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2017-03-25 18:31:20 +01:00
|
|
|
|
|
|
|
#=================================================
|
2022-02-26 14:23:25 +01:00
|
|
|
# RESTORE THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=2
|
|
|
|
|
|
|
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
|
|
|
|
2022-08-26 22:22:49 +02:00
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2022-02-26 14:23:25 +01:00
|
|
|
|
2020-12-31 23:19:32 +01:00
|
|
|
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql
|
2017-03-25 18:31:20 +01:00
|
|
|
|
|
|
|
#=================================================
|
2020-12-31 23:19:32 +01:00
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX AND PHP-FPM
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
|
2017-03-25 18:31:20 +01:00
|
|
|
#=================================================
|
2020-12-31 23:19:32 +01:00
|
|
|
# END OF SCRIPT
|
2017-03-25 18:31:20 +01:00
|
|
|
#=================================================
|
|
|
|
|
2020-12-31 23:19:32 +01:00
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|