Add useful comment

Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser 2025-05-30 19:03:12 +02:00 committed by GitHub
parent 888556278e
commit d177c4c776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -235,7 +235,9 @@ is_pid1() {
# Checks to see if the given command runs as PID 1 # Checks to see if the given command runs as PID 1
local is_pid1="$1" local is_pid1="$1"
ps -p 1 -o comm= | grep -q "${is_pid1}" # select PID 1, format output to show only CMD column without header
# quietly grep for a match on the function passed parameter
ps --pid 1 --format comm= | grep -q "${is_pid1}"
} }
# Compatibility # Compatibility