WAN IP AUTOCONFIG

Dear all .
there is a way to have a startup scipt that listen on the wan interface for a ping packet , when receive look the destination ip , and set it on the wan interface and disable the script?

You can’t receive a ping (ICMP) without an IP address.

Why can’t you use a DHCP client?

EDIT: Nevermind, he got the answer here.