1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/umami_ynh.git synced 2024-10-01 13:34:50 +02:00
umami_ynh/scripts/restore

55 lines
1.6 KiB
Text
Raw Normal View History

2022-06-15 16:26:48 +02:00
#!/bin/bash
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression "Restoring the app main directory..."
2022-06-15 16:26:48 +02:00
ynh_restore "$install_dir"
2022-06-15 16:26:48 +02:00
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression "Reinstalling dependencies..."
2022-06-15 16:26:48 +02:00
ynh_nodejs_install
2022-06-15 16:26:48 +02:00
#=================================================
2022-06-27 14:22:15 +02:00
# RESTORE THE DATABASE
2022-06-15 16:26:48 +02:00
#=================================================
ynh_script_progression "Restoring the database..."
2022-06-15 16:26:48 +02:00
ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pgcrypto;"
2024-09-29 09:13:50 +02:00
ynh_psql_db_shell < ./db.sql
2022-06-15 16:26:48 +02:00
#=================================================
2023-08-12 14:35:07 +02:00
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Restoring system configurations related to $app..."
2023-08-12 14:35:07 +02:00
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
2022-06-15 16:26:48 +02:00
ynh_restore "/etc/systemd/system/$app.service"
2022-06-15 16:26:48 +02:00
systemctl enable $app.service --quiet
yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
2022-06-15 16:26:48 +02:00
ynh_systemctl --service=$app --action="start"
2022-06-15 16:26:48 +02:00
ynh_systemctl --service=nginx --action=reload
2022-06-15 16:26:48 +02:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Restoration completed for $app"