1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 06:48:07 +00:00

Merge pull request #1818 from pi-hole/fix/debug

Use systemctl or service commands in debug script
This commit is contained in:
Jacob Salmela 2017-12-08 19:57:37 -06:00 committed by GitHub
commit 6c9e7586d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -809,8 +809,14 @@ process_status(){
local i
# For each process,
for i in "${PIHOLE_PROCESSES[@]}"; do
# get its status via systemctl
local status_of_process=$(systemctl is-active "${i}")
# If systemd
if command -v systemctl &> /dev/null; then
# get its status via systemctl
local status_of_process=$(systemctl is-active "${i}")
else
# Otherwise, use the service command
local status_of_process=$(service "${i}" status | awk '/Active:/ {print $2}') &> /dev/null
fi
# and print it out to the user
if [[ "${status_of_process}" == "active" ]]; then
# If it's active, show it in green