#!/bin/sh

manufacturer=`ipmitool mc info | sed -n '/Manufacturer Name/s/^.*: \(.*\)$/\1/gp'` || true
if [ -n "$manufacturer" ]; then
	device=`ipmitool mc info | sed -n '/Product ID/s/^.*: \(.*\)$/\1/gp'` || true
	serial=`ipmitool lan print | grep "MAC Address" | awk '{print $NF}'` || true
	$SHARE_DIR/add-component "BMC" "$manufacturer" "$device" "$serial"
else
	true
fi
