Fix systemd

This commit is contained in:
Alexander Schäferdiek 2019-01-25 20:00:45 +01:00
parent fde200fec8
commit 45e8033b20

View file

@ -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