1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

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() {
# 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