Guest User

Untitled

a guest
Nov 12th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. network={
  2. key_mgmt=NONE
  3. }
  4.  
  5. rpi ~$ cat get_ip_addr.sh
  6. #!/bin/bash
  7. # wait 30 sec if interface gets online
  8. /lib/systemd/systemd-networkd-wait-online --interface=$1 --timeout=30 --quiet
  9. if [ $? -ne 0 ]; then
  10. exit 1
  11. else
  12. /sbin/ip -4 -br addr show $1 | /bin/grep -Po "d+.d+.d+.d+"
  13. fi
  14.  
  15. rpi ~$ chmod +x get_ip_addr.sh
  16. rpi ~$ ./get_ip_addr.sh wlan0
  17. 192.168.4.37
  18.  
  19. rpi ~$ ./get_ip_addr.sh xxx
  20. Event loop failed: Connection timed out
  21. rpi ~$
Add Comment
Please, Sign In to add comment