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

56 lines
2 KiB
Text
Raw Normal View History

2020-10-11 15:21:19 +02:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
2024-02-05 15:30:16 +01:00
# RESTORE THE APP MAIN DIR
2020-10-11 15:21:19 +02:00
#=================================================
2024-02-05 15:30:16 +01:00
ynh_script_progression --message="Restoring the app main directory..." --weight=1
2020-10-11 15:21:19 +02:00
2024-02-05 15:30:16 +01:00
ynh_restore_file --origin_path="$install_dir"
2020-10-11 15:21:19 +02:00
2024-02-05 15:30:16 +01:00
chown -R "$app:www-data" "$install_dir"
2022-02-04 09:04:28 +01:00
#=================================================
2024-02-05 15:30:16 +01:00
# RESTORE SYSTEM CONFIGURATIONS
2022-02-04 09:04:28 +01:00
#=================================================
2024-02-05 15:30:16 +01:00
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
2022-02-04 09:04:28 +01:00
2024-02-05 15:30:16 +01:00
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
2022-02-04 09:04:28 +01:00
2024-02-05 15:30:16 +01:00
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable "$app.service" --quiet
2024-02-05 15:39:09 +01:00
yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app/$app.log"
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
2022-02-04 09:49:47 +01:00
2020-10-25 09:00:51 +01:00
#=================================================
2024-02-05 15:30:16 +01:00
# RESTORE VARIOUS FILES
2020-10-25 09:00:51 +01:00
#=================================================
2024-02-05 15:30:16 +01:00
ynh_script_progression --message="Restoring various file..." --weight=1
2020-10-25 09:00:51 +01:00
2024-02-05 15:39:09 +01:00
ynh_restore_file --origin_path="/var/log/$app"
2020-10-25 09:00:51 +01:00
#=================================================
2024-02-05 13:11:42 +01:00
# GENERIC FINALIZATION
2020-10-11 15:21:19 +02:00
#=================================================
2024-02-05 13:11:42 +01:00
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
2020-10-11 15:21:19 +02:00
#=================================================
2024-02-05 13:11:42 +01:00
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
2020-10-11 15:21:19 +02:00
2024-02-05 13:11:42 +01:00
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
2020-10-11 15:21:19 +02:00
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
2021-09-24 07:43:11 +02:00
ynh_script_progression --message="Restoration completed for $app" --last