Use systemd is-active instead of systemd status

This commit is contained in:
Josué Tille 2024-04-08 00:26:39 +02:00
parent 4bc7114e8f
commit 035adcf134
No known key found for this signature in database
GPG Key ID: 5F259226AD51F2F5

View File

@ -9,7 +9,7 @@ source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
if [[ ! "$(systemctl status $app.service)" =~ 'Active: inactive (dead)' ]]; then
if systemctl is-active $app.service --quiet; then
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'"
fi