From 45e8033b20d0dc4857610fc25ca10f7e828fcc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Fri, 25 Jan 2019 20:00:45 +0100 Subject: [PATCH] Fix systemd --- usr/local/bin/systemd_check | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/local/bin/systemd_check b/usr/local/bin/systemd_check index a3953ce..8db2f07 100755 --- a/usr/local/bin/systemd_check +++ b/usr/local/bin/systemd_check @@ -78,15 +78,15 @@ function checkService() { local ROOT_COMMAND="systemctl is-active --quiet $SERVICE"; local USER_COMMAND="systemctl --user is-active --quiet $SERVICE"; - local RESULT=1; + local RESULT=0; if [ "$(id -u)" != "0" ]; then - if [ $($USER_COMMAND) ]; then - RESULT=0; + if [ ! $($USER_COMMAND) ]; then + RESULT=1; fi else - if [ $($ROOT_COMMAND) ] || [ $($USER_COMMAND) ]; then - RESULT=0; + if [ ! $($ROOT_COMMAND) ] && [ ! $($USER_COMMAND) ]; then + RESULT=1; fi fi