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

54 lines
1.9 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 13:11:42 +01:00
# RESTORE SYSTEM CONFIGURATIONS
2020-10-11 15:21:19 +02:00
#=================================================
2024-02-05 13:11:42 +01:00
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
2020-10-11 15:21:19 +02:00
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
2024-02-05 13:11:42 +01:00
yunohost service add $app --description="Versatile web based messenger using IRC" --log="/var/log/$app.log"
2022-02-04 09:04:28 +01:00
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
2022-02-04 09:49:47 +01:00
ynh_script_progression --message="Restoring various file..." --weight=1
2022-02-04 09:04:28 +01:00
ynh_restore_file --origin_path="/etc/kiwiirc"
2022-02-04 09:49:47 +01:00
ynh_restore_file --origin_path="/var/log/$app.log"
2020-10-25 09:00:51 +01:00
#=================================================
2024-02-05 13:11:42 +01:00
# DOWNLOAD, CHECK AND UNPACK SOURCE
2020-10-25 09:00:51 +01:00
#=================================================
2024-02-05 13:11:42 +01:00
ynh_script_progression --message="Setting up source files..." --weight=2
2020-10-25 09:00:51 +01:00
2024-02-05 13:11:42 +01:00
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir
ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb
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