#!/bin/bash

#Set version and MAC (if this update is only targeted to a single DC.
VERSION=0.01
#TARGET_MAC = 00:11:22:33:44:66

#Set some environmental parameters
MAC=`/sbin/ifconfig eth0 | /usr/bin/head -1 | /bin/sed -e 's/.*HWaddr //'`

#Only action if this version of update is already done.
if [ ! -s software/$VERSION ];
then

#Uncomment the check below if this updated is targeted to a specific MAC.
#if [ $MAC -eq $TARGET_MAC ];
#then

#Remove any possible old version and go to software directory.
rm -Rf software
mkdir software
cd software

#Create version flag file, so we will not try to upgrade again for the same version. 
cat >> $VERSION  << EOF
$VERSION
EOF

echo $MAC

#fi

fi
