2017-07-23 17:46:25 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2017-07-23 17:46:25 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2021-03-18 11:26:27 +01:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Restoring the app main directory..."
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_restore "$install_dir"
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2022-12-09 18:01:27 +01:00
|
|
|
#=================================================
|
|
|
|
# APPLY FOLDER GROUP RIGHTS FOR WWW-DATA
|
|
|
|
#=================================================
|
2023-03-12 08:42:18 +01:00
|
|
|
|
2023-03-12 08:24:05 +01:00
|
|
|
chgrp -R www-data $install_dir
|
2022-12-09 18:01:27 +01:00
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
#=================================================
|
|
|
|
# REINSTALL DEPENDENCIES
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Reinstalling dependencies..."
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_nodejs_install
|
2018-05-04 11:52:10 +02:00
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2023-03-12 08:42:18 +01:00
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Restoring system configurations related to $app..."
|
2023-03-12 08:42:18 +01:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_restore "/etc/systemd/system/$app.service"
|
2020-12-04 11:33:12 +01:00
|
|
|
systemctl enable $app.service --quiet
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2020-12-04 11:33:12 +01:00
|
|
|
yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log"
|
2017-07-23 17:46:25 +02:00
|
|
|
|
|
|
|
#=================================================
|
2023-03-12 08:42:18 +01:00
|
|
|
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Reloading NGINX web server and $app's service..."
|
2023-03-12 08:42:18 +01:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="server available"
|
2020-07-18 11:46:45 +02:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_systemctl --service=nginx --action=reload
|
2020-07-18 11:46:45 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|