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:
parent
26e416674e
commit
987f075e80
2 changed files with 2 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue