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