#!/bin/sh
#
#  SLEEP 80 seconds before executing the scripts.
#
#####

SDIR="/usr/local/etc/solajithome/SettingsXML"

SYSFILE="${SDIR}/SystemSetting.xml"
DEFFILE="${SDIR}/DefaultSystemSetting.xml"

#Is there SystemSetting.xml?
if [ ! -e ${SYSFILE} ] ; then
    cp ${DEFFILE} ${SYSFILE}
fi

#SystemSetting.xml size check 

DEFSIZE=`wc -c ${DEFFILE} |awk '{print $1}'`
SYSSIZE=`wc -c ${SYSFILE} |awk '{print $1}'`

if [ $DEFSIZE -gt $SYSSIZE ] ; then
    cp ${SYSFILE} /var/tmp/SystemSetting.bak
    cp ${DEFFILE} ${SYSFILE}
fi


#cp /usr/local/etc/solajithome/SettingsXML/DefaultSystemSetting.xml /usr/local/etc/solajithome/SettingsXML/SystemSetting.xml

sleep 80

# Iedenchi Adjust Time
/usr/local/nerscripts/ieden_adjusttime.sh > /tmp/ieden_adjusttime.log 2>&1 &

exit 0
