The script in the run script is using below command to calculate the ip of the localhost:
export HOST_IP=$(ifconfig $(ifconfig | grep ^eth | cut -d' ' -f1 | tail -1) | grep 'inet addr' | cut -d':' -f2 | cut -d' ' -f1)
or
export HOST_IP=$(ifconfig $(ifconfig | grep ^eth | cut -d' ' -f1) | grep 'inet addr' | cut -d':' -f2 | cut -d' ' -f1)
Sometimes, it is working on my machine, sometimes not. when it's not working, it reports error as below:
eth1: Unknown host
or no output.
It turns out there are more than one ethernet interface on my ubuntu: "eth0" and "eth1".
It turns out the second one is only appears after I plugin my iphone, in which "personal hotspot" is turned on.
The solution is either plug out my iphone or run command to remove the ethernet interface:
ifconfig eth1 down