Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # mutt should be configured
- # to send email using mstmp and gmail
- myip_file=/tmp/myip.txt
- getip()
- {
- curl ifconfig.me/ip
- }
- mailme()
- {
- echo "$*" | mutt -s "Desk ip" danielhilst@gmail.com
- }
- ##
- oldip=$(cat $myip_file)
- newip=$(getip)
- if test "$oldip" != "$newip"; then
- echo $newip > $myip_file
- mailme $newip
- fi
Advertisement
Add Comment
Please, Sign In to add comment