mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
tidy up function
Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
parent
f18bf35b20
commit
e2e8b733a8
1 changed files with 5 additions and 10 deletions
|
@ -1178,15 +1178,10 @@ check_service_active() {
|
|||
if command -v systemctl &> /dev/null; then
|
||||
# use that to check the status of the service
|
||||
systemctl is-enabled "${1}" > /dev/null
|
||||
return $?
|
||||
# Otherwise,
|
||||
else
|
||||
# fall back to service command
|
||||
if service "${1}" status | grep "Active: active" > /dev/null; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
service "${1}" status > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -1824,7 +1819,7 @@ FTLinstall() {
|
|||
echo -e "${OVER} ${TICK} ${str}"
|
||||
# If the --resolver flag returns True (exit code 0), then we can safely stop & disable dnsmasq
|
||||
if pihole-FTL --resolver > /dev/null; then
|
||||
if [[ $(which dnsmasq 2>/dev/null) ]]; then
|
||||
if which dnsmasq > /dev/null; then
|
||||
if check_service_active "dnsmasq";then
|
||||
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
|
||||
stop_service dnsmasq
|
||||
|
|
Loading…
Reference in a new issue