From f18bf35b208813e798affdb15ed4333e46b8030a Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 17 Mar 2018 22:56:50 +0000 Subject: [PATCH] use `systemctl is-enabled` to check enabled status of service Signed-off-by: Adam Warner --- automated install/basic-install.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 6a160be6..ddebe6fa 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1176,12 +1176,9 @@ disable_service() { check_service_active() { # If systemctl exists, if command -v systemctl &> /dev/null; then - # use that to disable the service - if systemctl status "${1}" | grep -q "Active: active" > /dev/null; then - return 0 - else - return 1 - fi + # use that to check the status of the service + systemctl is-enabled "${1}" > /dev/null + return $? # Otherwise, else # fall back to service command @@ -1832,7 +1829,6 @@ FTLinstall() { echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately" stop_service dnsmasq disable_service dnsmasq - mask_service dnsmasq fi fi