From ed197a9b0ebc90175b548f771c62853a67599085 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 12 Jun 2021 11:17:50 +0200 Subject: [PATCH] Restart initial sonarr.service if multi-installed --- scripts/install | 7 +++++++ scripts/restore | 7 +++++++ scripts/upgrade | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/scripts/install b/scripts/install index 8291553..167bd40 100755 --- a/scripts/install +++ b/scripts/install @@ -139,6 +139,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 +# If a first Sonarr app was running before installing this one, +# it may have been stopped by the installation of the dependencies. +# Let's restart it. +if [[ $(systemctl list-units -all | grep 'sonarr.service' | grep 'inactive') ]]; then + ynh_exec_fully_quiet 'ynh_systemd_action --service_name=sonarr --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30' +fi + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index dc18191..250eae1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -112,6 +112,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 +# If a first Sonarr app was running before installing this one, +# it may have been stopped by the installation of the dependencies. +# Let's restart it. +if [[ $(systemctl list-units -all | grep 'sonarr.service' | grep 'inactive') ]]; then + ynh_exec_fully_quiet 'ynh_systemd_action --service_name=sonarr --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30' +fi + #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 19cfe8c..8dee388 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -129,6 +129,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 +# If a first Sonarr app was running before installing this one, +# it may have been stopped by the installation of the dependencies. +# Let's restart it. +if [[ $(systemctl list-units -all | grep 'sonarr.service' | grep 'inactive') ]]; then + ynh_exec_fully_quiet 'ynh_systemd_action --service_name=sonarr --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30' +fi + #================================================= # RELOAD NGINX #=================================================