My scripts wait until there is a valid IP address.
Then they send me an email so I know what it is.
It can take some time before the server on a network assigns it.
30 secs after booting is not unusual.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
You shouldn't assume that cron knows where to find your script. It's best to use the full pathname.
If you redirect the script output to a logfile you may get a clue to what went wrong.