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