forked from ungleich-public/cdist
explorer/init/Linux: replace ps by pgrep
BusyBox's version of ps does not support the -o option. On Linux systems, use pgrep -P0 -l to get the name of pid 1.
This commit is contained in:
parent
ceb97fd0ee
commit
5646a66f6c
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2016 Daniel Heule (hda at sfs.biz)
|
||||
# Copyright 2017, Philippe Gregoire <pg@pgregoire.xyz>
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
|
@ -25,7 +26,10 @@
|
|||
uname_s="$(uname -s)"
|
||||
|
||||
case "$uname_s" in
|
||||
Linux|FreeBSD)
|
||||
Linux)
|
||||
pgrep -P0 -l | awk '/^1[ \t]/ {print $2;}'
|
||||
;;
|
||||
FreeBSD)
|
||||
ps -o comm= -p 1 || true
|
||||
;;
|
||||
*)
|
||||
|
|
Loading…
Reference in a new issue