# Process the incoming configuration files

if [ ! -f etc/ntp.conf ]
then
   mv install/conf/etc/ntp.conf etc/ntp.conf
else
   if [ "`md5sum install/conf/etc/ntp.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ntp.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ntp.conf etc/ntp.conf
   else
      rm install/conf/etc/ntp.conf
   fi
fi

if [ ! -f etc/ntp/ntp.keys ]
then
   mv install/conf/etc/ntp/ntp.keys etc/ntp/ntp.keys
else
   if [ "`md5sum install/conf/etc/ntp/ntp.keys | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ntp/ntp.keys | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ntp/ntp.keys etc/ntp/ntp.keys
   else
      rm install/conf/etc/ntp/ntp.keys
   fi
fi

# Make sure the incoming conf directory is gone
rm -rf install/conf
