From 0c75e0676869b98a9883ad0e2af20bc192a4b945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 8 Apr 2024 00:30:00 +0200 Subject: [PATCH] Use systemd is-active instead of systemd status --- scripts/backup | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index b5a8e07..91a88cc 100644 --- a/scripts/backup +++ b/scripts/backup @@ -11,10 +11,7 @@ source ../settings/scripts/_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers -# retrieve useful param -seafile_version=$(ynh_app_upstream_version) - -if [[ ! "$(systemctl status seafile)" =~ "Active: inactive (dead)" ]] || [[ ! "$(systemctl status seahub)" =~ "Active: failed (Result: signal)" ]]; then +if systemctl is-active seafile --quiet || systemctl is-active seahub --quiet; then ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop seafile service and seahub service with this command before to run the backup 'systemctl stop seafile.service seahub.service'" fi