1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webmin_ynh.git synced 2024-09-03 20:36:08 +02:00
webmin_ynh/scripts/restore
eric_G 7172ad73f3
Version 2 (#52)
* v2

* fix

* fix

* fix

* Auto-update README

* Update manifest.toml

* Update manifest.toml

* Update manifest.toml

* fix

* Update manifest.toml

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2023-10-18 12:02:58 +02:00

75 lines
2.6 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..."
tempdir="$(mktemp -d)"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$tempdir"
dpkg --install $tempdir/webmin.deb
ynh_exec_warn_less ynh_secure_remove --file="$tempdir"
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="/etc/webmin/miniserv.conf"
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..."
systemctl daemon-reload
systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description="Webmin Daemon"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started LSB" --log_path="systemd"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app"