Commit a3130a08 authored by Dan Reading's avatar Dan Reading
Browse files

add comparision of testbed db and found. save differences in /prog. put full...

add comparision of testbed db and found. save differences in /prog. put full inventory fill in subdir /proj/emulab-ops/nodecheck/Complete/
parent 763c22b4
......@@ -17,7 +17,7 @@ mywhich() {
if [ -f '/etc/emulab/ismfs' ] ; then
# check to see if we are using correct bash
verbash=$(file `mywhich bash`)
if [ -z $verbash ] ; then
if [ -z "$verbash" ] ; then
verbash=$(file -m /proj/emulab-ops/nodecheck/FreeBSD/bin/magic `mywhich bash`)
fi
if [ "$verbash" != "${verbash/busybox}" ] ; then
......@@ -45,22 +45,45 @@ set +e
# read in the newly found info
readtmcinfo /tmp/nodecheck.log.tb
# print it back out
# print it back out for the database
{ printtmcinfo
} > /tmp/nodecheck.log.tb.new
} > /tmp/nodecheck.log.tb.new # .new not necessary should reuse name
# print
# print full locally found
{ printhwinv
} > /tmp/nodecheck.log.inv
host=$(/usr/local/etc/emulab/tmcc.bin nodeid)
# make sure proj got mounted
if [ ! -d /proj/emulab-ops ] ; then
echo "OHhh all this work for nothing"
echo "/proj/emulab-ops not mounted can't save info"
exit 1
fi
# have needed dirs ?
mkdir -p /proj/emulab-ops/nodecheck/Complete
$(cp /tmp/nodecheck.log.tb.new /proj/emulab-ops/nodecheck/$host);
$(cp /tmp/nodecheck.log.inv /proj/emulab-ops/nodecheck/$host.full);
$(chmod a+r /proj/emulab-ops/nodecheck/$host*);
$(cp /tmp/nodecheck.log.inv /proj/emulab-ops/nodecheck/Complete/$host);
$(chmod a+r /proj/emulab-ops/nodecheck/$host /proj/emulab-ops/nodecheck/Complete/$host);
# Test what found local against what is in the database
readtmcinfo # info from tmcc.bin hwinv
copytmcinfo # copy into hwinvcopy
readtmcinfo /proj/emulab-ops/nodecheck/$host # read local found into hwinv
{ comparetmcinfo
} > /tmp/$host.diff
cat /tmp/$host.diff
if [ -s /tmp/$host.diff ] ; then
$(cp /tmp/$host.diff /proj/emulab-ops/nodecheck)
$(chmod a+r /proj/emulab-ops/nodecheck/$host.diff);
fi
# echo "NEED TO ENABLE rm -f /tmp/nodecheck.log.tb /tmp/nodecheck.log.inv"
# echo "NEED TO ENABLE rm -f /tmp/nodecheck.log.tb.new /tmp/$host.diff"
}
gatherinv_main $0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment