Use systemd is-active instead of systemd status

This commit is contained in:
Josué Tille 2024-04-08 00:30:00 +02:00
parent a73097649c
commit 0c75e06768
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5

View file

@ -11,10 +11,7 @@ source ../settings/scripts/_common.sh
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# retrieve useful param if systemctl is-active seafile --quiet || systemctl is-active seahub --quiet; then
seafile_version=$(ynh_app_upstream_version)
if [[ ! "$(systemctl status seafile)" =~ "Active: inactive (dead)" ]] || [[ ! "$(systemctl status seahub)" =~ "Active: failed (Result: signal)" ]]; 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'" 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 fi