Ledger Nano X - The secure hardware wallet
SHARE
TWEET

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
  2.  
  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.
  5.  
  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}
  10.  
  11. if [ $len_ext_ip -gt 16 ]; then
  12.         # more than 16 digits, it's garbage; we're not connected.
  13.         echo "0.0.0.0"
  14. else
  15.         # return the actual ip address.
  16.         echo "$ext_ip"
  17. fi
  18.  
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
Top