mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +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() {
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue