Advertisement
natemara

email-ip.sh

Nov 7th, 2013
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #!/bin/bash
  2. sbin/ifconfig |grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3 }' > message.txt 2> message.txt
  3. /home/pi/TheProject/Scripts/sendEmail/sendEmail -f "[from-address]" -t "[to-address]" -u "#IPINFO"  "$ip_info" -s smtp.gmail.com:587 -o message-file=message.txt tls=yes -xu "[email-username]" -xp "[email-password]"
  4. rm message.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement