# Process the incoming configuration files

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

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

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

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