Get Public IP and copy it to Clipboard


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  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"

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.