1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vikunja_ynh.git synced 2024-09-03 18:06:26 +02:00
vikunja_ynh/scripts/restore

46 lines
1.5 KiB
Text
Raw Normal View History

2021-08-05 17:28:35 +02:00
#!/bin/bash
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression "Restoring $app main directory..."
ynh_restore "$install_dir"
2021-08-08 14:00:19 +02:00
2021-08-05 17:28:35 +02:00
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression "Restoring the PostgreSQL database..."
2021-08-05 17:28:35 +02:00
ynh_psql_db_shell < ./db.sql
2021-08-05 17:28:35 +02:00
#=================================================
2023-10-27 09:20:57 +02:00
# RESTORE SYSTEM CONFIGURATIONS
2021-08-05 17:28:35 +02:00
#=================================================
ynh_script_progression "Restoring system configurations related to $app..."
2021-08-05 17:28:35 +02:00
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
2023-10-27 09:12:57 +02:00
ynh_restore "/etc/systemd/system/$app.service"
2021-08-05 17:28:35 +02:00
systemctl enable $app.service --quiet
yunohost service add $app --description="Self-hosted To-Do list application" --log="/var/log/$app/$app.log"
2023-10-27 09:20:57 +02:00
#=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
2021-08-05 17:28:35 +02:00
#=================================================
ynh_script_progression "Reloading NGINX web server and $app's service..."
2021-08-05 17:28:35 +02:00
ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="server started on"
2021-08-05 17:28:35 +02:00
ynh_systemctl --service=nginx --action=reload
2021-08-05 17:28:35 +02:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Restoration completed for $app"