how to update atmega online by ethernet?

not by bootloader from serial port.

i want receive the data from the ethernet,then update itsself.
the main problem is how to define the #pragma section of the update procedue in arduino,who can tell me?

I think you will find that an irrelevant #pragma is hardly the "main problem"

You have to re-write the bootloader. Someone has one that updates via SD card, you can search for that.

thanks for your reply.
i searched around,but not find the one you said. do you have some clues for me to search it out?

The Moteinos can update over the air. I think the code for the bootloader is published. It is more complex than you expect. The blog postings give a good overview of the process.