- sending an email of IP address on booting, works for both python2 and python3.
- dig is required if you want to get your public IP address.
- make sure
/etc/rc.local
exists sudo sed -i '/^exit 0/ c\(sleep 30 && $(which curl) -sL https://raw.githubusercontent.com/dianyij/rpi/master/bootmail.py | $(which python || which python3) - to@gmail.com from@gmail.com from_password) &\n\nexit 0' /etc/rc.local
- download the script to
/home/pi/.bootmail.py
- change the settings and message
sudo vi /etc/rc.local
- insert
$(which python || which python3) /home/pi/.bootmail.py &
beforeexit 0