From 451752901c399efa05eb0ed924ead4dec2b1fd43 Mon Sep 17 00:00:00 2001 From: ThomasC Date: Tue, 23 Mar 2021 22:03:55 +0100 Subject: [PATCH] localize serviceIsEnabled, remove serviceIsActive --- functions.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/functions.sh b/functions.sh index 0c0bf76..c93a19d 100644 --- a/functions.sh +++ b/functions.sh @@ -214,14 +214,8 @@ function commandStdoutPattern { # arg1: service function serviceIsEnabled { service=$1 - if ( systemctl is-enabled $1 &> /dev/null ) ; then echo -ne "1;" ; else echo -ne "0;" ; fi -} - -# ok if given service is active -# arg1: service -function serviceIsActive { - service=$1 - if ( systemctl is-active $1 &> /dev/null ) ; then echo -ne "1;" ; else echo -ne "0;" ; fi + service=/etc/systemd/system/multi-user.target.wants/${1}.service + if [ -h $service ] ; then e 1 ; else e 0 ; fi } # ok if output of given url contains given stuff