Posted By

ertbor on 01/23/11


Tagged

ip


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

julianrhyswilliams


Get Public IP and copy it to Clipboard


 / Published in: Bash
 

URL: http://hints.macworld.com/article.php?story=20110113070834584

  1. #!/bin/bash
  2. MYIP=`curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.\.]*\).*/\1/g'`
  3. echo $MYIP | pbcopy
  4. /usr/local/bin/growlnotify 'IP address copied' -m "Address was: $MYIP"

Report this snippet  

You need to login to post a comment.