Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. SUBJ="Public IP server"
  4. EMAIL="franpintosantos@gmail.com"
  5.  
  6. ip1=""
  7. ip2=""
  8.  
  9. read ip1 < ip.txt
  10. ip2=$(wget -qO- ifconfig.me/ip)
  11.  
  12. if [ "$ip1" = "$ip2" ]
  13. then
  14. exit
  15. else
  16. echo "$ip2" > ip.txt
  17. echo "$ip2" | mail -s $SUBJ $EMAIL
  18. exit
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement