since both $ip_addr and $old_ip_addr are ending up blank when it runs from cron, perhaps turning on xtrace and then examining the resulting output from the cron invocation could give you the clue on what's not working.
putting
set -x
before the ip_addr= line should do the trick. then let cron run and you should get a bunch of output in the resulting email (or you could redirect the output as another user mentioned. bearing in mind that xtrace emits to stderr, so use something like
* * * * * script >/tmp/outputfile 2>&1