2016-01-10 20:10:16 +01:00
|
|
|
#!/bin/bash
|
2016-05-10 14:21:26 +02:00
|
|
|
|
2019-04-09 22:19:55 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2017-08-27 14:42:28 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-01-10 20:10:16 +01:00
|
|
|
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2021-05-18 09:26:51 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Restoring the app main directory..."
|
2021-05-18 09:26:51 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_restore "$install_dir"
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2022-06-06 19:06:50 +02:00
|
|
|
#=================================================
|
2023-12-05 20:36:42 +01:00
|
|
|
# RESTORE THE POSTGRESQL DATABASE
|
2022-06-06 19:06:50 +02:00
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Restoring the PostgreSQL database..."
|
2022-06-06 19:06:50 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_psql_db_shell < ./db.sql
|
2022-06-06 19:06:50 +02:00
|
|
|
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2020-08-14 14:42:08 +02:00
|
|
|
# RESTORE THE PHP-FPM CONFIGURATION
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Restoring system configurations related to $app..."
|
2020-08-14 14:42:08 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
2017-08-27 14:42:28 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2021-12-28 09:58:39 +01:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_restore "/etc/systemd/system/$app.service"
|
2021-05-18 09:26:51 +02:00
|
|
|
systemctl enable $app.service --quiet
|
|
|
|
|
2020-12-04 14:11:53 +01:00
|
|
|
yunohost service add $app --description="News feed reader and aggregator" --log="/var/log/$app/$app.log"
|
2020-11-20 12:28:18 +01:00
|
|
|
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2023-12-05 20:36:42 +01:00
|
|
|
# START SYSTEMD SERVICE
|
2017-08-27 14:42:28 +02:00
|
|
|
#=================================================
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2019-05-01 20:35:48 +02:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
|
|
|
ynh_systemctl --service=php$php_version-fpm --action=reload
|
2023-03-11 13:53:38 +01:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_systemctl --service=nginx --action=reload
|
2019-05-01 20:35:48 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2016-01-10 20:10:16 +01:00
|
|
|
|
2024-09-08 13:32:10 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|