mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +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:
parent
44d8cb77e3
commit
f18bf35b20
1 changed files with 3 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue