2016-05-04 14:17:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
2019-03-04 16:23:36 +01:00
|
|
|
# IMPORT GENERIC HELPERS
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
2021-02-13 19:19:24 +01:00
|
|
|
source ../settings/scripts/_common.sh
|
2019-03-04 16:23:36 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-04 14:17:07 +02:00
|
|
|
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
# RESTORE THE NGINX CONFIGURATION
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
ynh_script_progression --message="Restoring the NGINX web server configuration..."
|
2017-08-28 16:34:15 +02:00
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2017-08-28 16:34:15 +02:00
|
|
|
|
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
# RESTORE VARIOUS FILES
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
ynh_script_progression --message="Restoring various files..." --weight=3
|
2017-08-28 16:34:15 +02:00
|
|
|
|
2019-05-20 17:03:46 +02:00
|
|
|
ynh_restore_file --origin_path="/etc/shellinabox"
|
|
|
|
ynh_restore_file --origin_path="/etc/default/shellinabox"
|
2018-03-08 00:25:33 +01:00
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
#=================================================
|
|
|
|
# RESTORE SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Restoring the systemd configuration..."
|
|
|
|
|
2018-03-08 00:25:33 +01:00
|
|
|
# Allow the service to log in syslog
|
2019-05-20 17:03:46 +02:00
|
|
|
ynh_replace_string --match_string=" -- -q --background" --replace_string=" -- --background" --target_file="/etc/init.d/shellinabox"
|
|
|
|
|
2018-03-08 00:51:15 +01:00
|
|
|
systemctl daemon-reload
|
2018-03-08 00:25:33 +01:00
|
|
|
|
2017-12-04 22:02:18 +01:00
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
2017-12-04 22:02:18 +01:00
|
|
|
#=================================================
|
2022-01-04 23:32:01 +01:00
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
2017-12-04 22:02:18 +01:00
|
|
|
|
2022-01-04 23:32:01 +01:00
|
|
|
yunohost service add $app --description="Web based AJAX terminal emulator"
|
2017-12-04 22:02:18 +01:00
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=shellinabox --action=restart
|
|
|
|
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX
|
|
|
|
#=================================================
|
2022-01-04 23:32:01 +01:00
|
|
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
2017-08-28 16:34:15 +02:00
|
|
|
|
2019-05-20 17:03:46 +02:00
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
2019-03-04 16:24:27 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2019-05-20 17:03:46 +02:00
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|