do file check early
check "ip ne show" output

Sometimes after switching between unconfigured devices ping would
succeed but "ip ne" would not return a MAC address. Did not look
into the reason, here is a change that works around the issue.
bashisms depend on bash

"read" with timeout is supported by bash but not dash, which is the
/bin/sh in Ubuntu.