mirror of https://github.com/CISOfy/lynis.git
\-C flag of ps is different on BSD
This commit is contained in:
parent
7ae81514b4
commit
c487bcb277
|
@ -208,6 +208,7 @@ unset LANG
|
||||||
PROFILES=""
|
PROFILES=""
|
||||||
PROFILEVALUE=""
|
PROFILEVALUE=""
|
||||||
PSBINARY="ps"
|
PSBINARY="ps"
|
||||||
|
PSOPTIONS=""
|
||||||
PUPPETBINARY=""
|
PUPPETBINARY=""
|
||||||
READLINKBINARY=""
|
READLINKBINARY=""
|
||||||
REDIS_RUNNING=0
|
REDIS_RUNNING=0
|
||||||
|
|
|
@ -1253,6 +1253,7 @@
|
||||||
# Description : Check if a process is running
|
# Description : Check if a process is running
|
||||||
# Returns : 0 (process is running), 1 (process not running)
|
# Returns : 0 (process is running), 1 (process not running)
|
||||||
# RUNNING (1 = running, 0 = not running) - will be deprecated
|
# RUNNING (1 = running, 0 = not running) - will be deprecated
|
||||||
|
# Notes : PSOPTIONS are declared globally, to prevent testing each call
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
IsRunning() {
|
IsRunning() {
|
||||||
|
@ -1276,8 +1277,16 @@
|
||||||
if [ ! -z "${PGREPBINARY}" ]; then
|
if [ ! -z "${PGREPBINARY}" ]; then
|
||||||
FIND=$(${PGREPBINARY} ${pgrep_options} "${search}" | ${TRBINARY} '\n' ' ')
|
FIND=$(${PGREPBINARY} ${pgrep_options} "${search}" | ${TRBINARY} '\n' ' ')
|
||||||
else
|
else
|
||||||
PSOPTIONS=" -o args="
|
if [ -z "${PSOPTIONS}" ]; then
|
||||||
if [ ${SHELL_IS_BUSYBOX} -eq 0 ]; then PSOPTIONS=" -o args= -C ${search}"; fi
|
PSOPTIONS=" -o args="
|
||||||
|
if [ ${SHELL_IS_BUSYBOX} -eq 0 ]; then
|
||||||
|
case "${OS}" in
|
||||||
|
"Linux")
|
||||||
|
PSOPTIONS=" -o args= -C ${search}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
FIND=$(${PSBINARY} ${PSOPTIONS} | egrep "( |/)${search}" | grep -v "grep")
|
FIND=$(${PSBINARY} ${PSOPTIONS} | egrep "( |/)${search}" | grep -v "grep")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue