mirror of https://github.com/CISOfy/lynis.git
Ensure sysctl is present before calling it
This commit is contained in:
parent
7ad2dd5480
commit
95d5cabdb2
|
@ -512,12 +512,14 @@
|
|||
logtext "Result: file /etc/sysconfig/network does not exist"
|
||||
fi
|
||||
|
||||
# Check sysctl (e.g. FreeBSD)
|
||||
logtext "Test: checking sysctl for kern.domainname"
|
||||
FIND=`sysctl -a 2>&1 | grep "^kern.domainname" | awk -F: '{ print $2 }' | sed 's/ //g' | grep -v "^$"`
|
||||
if [ ! "${FIND}" = "" ]; then
|
||||
logtext "Result: found NIS domain via sysctl"
|
||||
NISDOMAIN="${FIND}"
|
||||
if [ ! "${SYSCTLBINARY}" = "" ]; then
|
||||
# Check sysctl (e.g. FreeBSD)
|
||||
logtext "Test: checking sysctl for kern.domainname"
|
||||
FIND=`${SYSCTLBINARY} -a 2>&1 | grep "^kern.domainname" | awk -F: '{ print $2 }' | sed 's/ //g' | grep -v "^$"`
|
||||
if [ ! "${FIND}" = "" ]; then
|
||||
logtext "Result: found NIS domain via sysctl"
|
||||
NISDOMAIN="${FIND}"
|
||||
fi
|
||||
fi
|
||||
# Check if we found any NIS domain
|
||||
if [ ! "${NISDOMAIN}" = "" ]; then
|
||||
|
|
Loading…
Reference in New Issue