#!/bin/bash
for i in `seq 1 $(cat ipmi.list |wc -l)` 
do 
   rm -rf DMI.txt
   IPMI_IP=`cat ipmi.list |sed -n "$i"p |awk '{print $1}'`
   SN=`cat ipmi.list |sed -n "$i"p |awk '{print $2}'`
   echo "$IPMI_IP"
   ./sum -i ${IPMI_IP} -u root -p ucloud.cn -c EditDmiInfo --file DMI.txt --item_type "system" --item_name "Serial Number" --value "${SN}"
sleep 5
./sum -i ${IPMI_IP} -u root -p ucloud.cn -c ChangeDmiInfo --file DMI.txt --reboot
sleep 10
 done
