commit 988509f076dbf5ea64e70c17f0211ded4d868a7d parent f4613ba20afa3d128db438d280d26e1b0d3d2198 Author: Claudio Alessi <smoppy@gmail.com> Date: Sun, 11 Dec 2016 15:30:57 +0100 [iwpick] Use the IP address supplied by the router. Diffstat:
M | src/iwpick | | | 8 | +++----- |
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/iwpick b/src/iwpick @@ -22,11 +22,9 @@ connect() { rm $tmp fi - # sdhcp wait forever if $iface have no IP address. Workaround this. - t=$(ifconfig $iface |grep inet: |cut -d: -f2 |cut -d' ' -f1) - [ -z $t ] && ifconfig $iface 192.168.0.2 - - sdhcp -d $iface >/dev/null + sdhcp -d $iface >/dev/null & + addr="$(tcpdump -vlni $iface -c 1 -Q in udp 2>&1 |grep "Your-IP" |tr -d [:space:] |cut -b8-)" + ifconfig $iface $addr } die() {