#!/bin/bash # 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 #================================================= # STANDARD RESTORATION STEPS #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= ynh_script_progression "Restoring the NGINX configuration..." ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" #================================================= # RESTORE THE APP DATA DIR #================================================= ynh_script_progression "Restoring the app data directory..." ynh_restore "$data_dir" chown -R $app: "$data_dir" #================================================= # YUNOHOST MULTIMEDIA INTEGRATION #================================================= ynh_script_progression "Adding multimedia directories..." # Build YunoHost multimedia directories ynh_multimedia_build_main_dir # Enable writing into these directories ynh_multimedia_addaccess $app #================================================= # RESTORE SYSTEMD #================================================= ynh_script_progression "Restoring $app's systemd service..." ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression "Integrating service in YunoHost..." yunohost service add $app --description="Lidarr daemon" --log="$data_dir/logs/lidarr.txt" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service=$app --action="start" --log_path="systemd" --wait_until="Application started" #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= ynh_script_progression "Restoring the logrotate configuration..." ynh_restore "/etc/logrotate.d/$app" #================================================= # RELOAD NGINX #================================================= ynh_script_progression "Reloading NGINX web server..." ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Restoration completed for $app"