use first device for cur_ip rather than assume eth0
Merge pull request #25 from sosiouxme/pr23

generalizes solution in #23