1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00

Use systemd is-active instead of systemd status

This commit is contained in:
Josué Tille 2024-04-08 00:28:45 +02:00
parent 26e416674e
commit 987f075e80
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5
2 changed files with 2 additions and 3 deletions

View file

@ -1,7 +1,6 @@
#/bin/bash
if [[ $(systemctl status __APP__.service | grep "Active" | cut -d'(' -f2 | cut -d ')' -f1) = 'running' ]]
then
if systemctl is-active __APP__.service --quiet; then
systemctl stop monitorix.service
sleep 1
pkill -f "monitorix-httpd listening on" || true

View file

@ -15,7 +15,7 @@ load_vars
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
if [[ ! "$(systemctl status $app.service)" =~ "Active: inactive (dead)" ]]; then
if systemctl is-active $app.service --quiet; then
ynh_print_warn --message="It's highly 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