Ledger Nano X - The secure hardware wallet

Check for IP address at hotspot

uriel1998 Oct 24th, 2011 130 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  3. #Sometimes when I've hooked up to a hotspot, before the "login" I'll get a bunch of crap
  4. #instead of an actual IP address in my conky config.  This fixes that.
  6. #check for ip address
  7. ext_ip=$(wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g')
  8. #check the length of the returned string.
  9. len_ext_ip=${#ext_ip}
  11. if [ $len_ext_ip -gt 16 ]; then
  12.         # more than 16 digits, it's garbage; we're not connected.
  13.         echo ""
  14. else
  15.         # return the actual ip address.
  16.         echo "$ext_ip"
  17. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand