Changed some report calls to ReportException

This commit is contained in:
mboelen 2014-08-28 13:50:08 +02:00
parent 4a7d10d8d6
commit 0228bd5317

View File

@ -290,14 +290,14 @@
else else
FIND=`${IFCONFIGBINARY} 2> /dev/null | grep "ether " | awk '{ print $2 }' | head -1 | tr '[:upper:]' '[:lower:]'` FIND=`${IFCONFIGBINARY} 2> /dev/null | grep "ether " | awk '{ print $2 }' | head -1 | tr '[:upper:]' '[:lower:]'`
if [ "${FIND}" = "" ]; then if [ "${FIND}" = "" ]; then
report "exception[]=No eth0 found (and no ether was found with ifconfig)" ReportException "GetHostID" "No eth0 found (and no ether was found with ifconfig)"
else else
logtext "Result: No eth0 found (ether found), using first network interface to determine hostid (with ifconfig)" logtext "Result: No eth0 found (ether found), using first network interface to determine hostid (with ifconfig)"
fi fi
fi fi
else else
FIND=`${IFCONFIGBINARY} 2> /dev/null | grep HWaddr | head -1 | awk '{ print $5 }' | tr '[:upper:]' '[:lower:]'` FIND=`${IFCONFIGBINARY} 2> /dev/null | grep HWaddr | head -1 | awk '{ print $5 }' | tr '[:upper:]' '[:lower:]'`
report "exception[]=No eth0 found (but HWaddr was found), using first network interface to determine hostid, with ifconfig" ReportException "GetHostID" "No eth0 found (but HWaddr was found), using first network interface to determine hostid, with ifconfig"
fi fi
fi fi
fi fi
@ -311,7 +311,7 @@
# Determine the MAC address of first interface with the ip command # Determine the MAC address of first interface with the ip command
FIND=`${IPBINARY} addr show 2> /dev/null | egrep "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]'` FIND=`${IPBINARY} addr show 2> /dev/null | egrep "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]'`
if [ "${FIND}" = "" ]; then if [ "${FIND}" = "" ]; then
report "exception[]=Can't create hostid (no MAC addresses found)" ReportException "GetHostID" "Can't create hostid (no MAC addresses found)"
fi fi
fi fi
@ -321,7 +321,7 @@
logtext "Result: Found HostID: ${HOSTID}" logtext "Result: Found HostID: ${HOSTID}"
fi fi
else else
report "exception[]=Can't create HOSTID, command ip not found" ReportException "GetHostID" "Can't create HOSTID, command ip not found"
fi fi
;; ;;