use systemctl is-enabled to check enabled status of service

Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
Adam Warner 2018-03-17 22:56:50 +00:00
parent 44d8cb77e3
commit f18bf35b20
No known key found for this signature in database
GPG key ID: F5410858022DA5EB

View file

@ -1176,12 +1176,9 @@ disable_service() {
check_service_active() { check_service_active() {
# If systemctl exists, # If systemctl exists,
if command -v systemctl &> /dev/null; then if command -v systemctl &> /dev/null; then
# use that to disable the service # use that to check the status of the service
if systemctl status "${1}" | grep -q "Active: active" > /dev/null; then systemctl is-enabled "${1}" > /dev/null
return 0 return $?
else
return 1
fi
# Otherwise, # Otherwise,
else else
# fall back to service command # fall back to service command
@ -1832,7 +1829,6 @@ FTLinstall() {
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately" echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
stop_service dnsmasq stop_service dnsmasq
disable_service dnsmasq disable_service dnsmasq
mask_service dnsmasq
fi fi
fi fi