Ensure sysctl is present before calling it

This commit is contained in:
mboelen 2015-04-07 17:20:11 +02:00
parent 7ad2dd5480
commit 95d5cabdb2
1 changed files with 8 additions and 6 deletions

View File

@ -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