2019-08-07 14:58:31 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-03 14:41:42 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2021-06-01 11:59:24 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2020-11-03 14:41:42 +01:00
|
|
|
#=================================================
|
2021-06-01 11:59:24 +02:00
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
|
|
|
|
2023-03-27 18:43:59 +02:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2020-11-03 14:41:42 +01:00
|
|
|
|
2023-03-27 18:43:59 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
chmod +x $install_dir/bin/runSafe.sh
|
2020-11-03 14:41:42 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC RESTORATION
|
|
|
|
#=================================================
|
|
|
|
# REINSTALL DEPENDENCIES
|
|
|
|
#=================================================
|
2023-03-27 18:48:41 +02:00
|
|
|
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
2020-11-03 14:41:42 +01:00
|
|
|
|
|
|
|
# Install Nodejs
|
|
|
|
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
|
|
|
|
|
|
|
#=================================================
|
2023-04-02 22:08:59 +02:00
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
2020-11-03 14:41:42 +01:00
|
|
|
#=================================================
|
2023-04-02 22:08:59 +02:00
|
|
|
# RESTORE THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
|
|
|
|
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2020-11-03 14:41:42 +01:00
|
|
|
|
|
|
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
2021-04-20 21:36:55 +02:00
|
|
|
systemctl enable $app.service --quiet
|
2020-11-03 14:41:42 +01:00
|
|
|
|
2021-04-20 21:43:18 +02:00
|
|
|
yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log"
|
2020-11-03 14:41:42 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-04-20 21:31:56 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
2020-11-03 14:41:42 +01:00
|
|
|
|
2022-04-09 09:48:58 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
2020-11-03 14:41:42 +01:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-04-20 21:31:56 +02:00
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|