1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lychee_ynh.git synced 2024-09-03 19:36:36 +02:00
lychee_ynh/scripts/restore

57 lines
1.9 KiB
Text
Raw Normal View History

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
#=================================================
ynh_script_progression "Restoring the app main directory..."
2020-11-06 21:41:02 +01: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
#=================================================
# RESTORE THE DATA DIRECTORY
2021-06-23 11:47:36 +02:00
#=================================================
ynh_script_progression "Restoring the data directory..."
2021-06-23 11:47:36 +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"
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
#=================================================
ynh_script_progression "Restoring the MySQL database..."
2024-06-19 15:10:40 +02:00
ynh_mysql_db_shell < ./db.sql
2024-06-19 15:10:40 +02:00
2023-12-30 10:52:22 +01:00
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
2023-12-30 10:52:22 +01:00
#=================================================
ynh_script_progression "Restoring system configurations related to $app..."
2020-11-06 21:41:02 +01:00
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
2020-11-06 21:41:02 +01:00
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
2020-11-06 21:41:02 +01:00
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
2020-11-06 21:41:02 +01: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
#=================================================
ynh_script_progression "Restoration completed for $app"