Advertisement
v1ral_ITS

my public and private IP shell script

Oct 10th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. #!/bin/bash
  2. # Show Your Public IP Saved To Home Filename
  3. #+ <  ** ip **  >
  4.  
  5. # Your Ip Brought To You Easily By ITS
  6. # v1ral_its@netc.it
  7.  
  8. # Define private command
  9. read priv_ip < <(wget http://checkip.dyndns.org/ -q -O - | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>')
  10. # Define public Command
  11. read my_ip < <(curl -s ipinfo.io/ip)
  12.  
  13. # Execute
  14. printf '\033[033mPublic IP: \033[m'
  15.     echo $my_ip
  16. printf '\033[033mPrivate IP: \033[m'
  17.     echo $priv_ip
  18.  
  19. # Done
  20. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement