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"
|
logtext "Result: file /etc/sysconfig/network does not exist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check sysctl (e.g. FreeBSD)
|
if [ ! "${SYSCTLBINARY}" = "" ]; then
|
||||||
logtext "Test: checking sysctl for kern.domainname"
|
# Check sysctl (e.g. FreeBSD)
|
||||||
FIND=`sysctl -a 2>&1 | grep "^kern.domainname" | awk -F: '{ print $2 }' | sed 's/ //g' | grep -v "^$"`
|
logtext "Test: checking sysctl for kern.domainname"
|
||||||
if [ ! "${FIND}" = "" ]; then
|
FIND=`${SYSCTLBINARY} -a 2>&1 | grep "^kern.domainname" | awk -F: '{ print $2 }' | sed 's/ //g' | grep -v "^$"`
|
||||||
logtext "Result: found NIS domain via sysctl"
|
if [ ! "${FIND}" = "" ]; then
|
||||||
NISDOMAIN="${FIND}"
|
logtext "Result: found NIS domain via sysctl"
|
||||||
|
NISDOMAIN="${FIND}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# Check if we found any NIS domain
|
# Check if we found any NIS domain
|
||||||
if [ ! "${NISDOMAIN}" = "" ]; then
|
if [ ! "${NISDOMAIN}" = "" ]; then
|
||||||
|
|
Loading…
Reference in New Issue