Last active
January 26, 2016 08:37
-
-
Save bugyt/110378e82252f8e5a88f to your computer and use it in GitHub Desktop.
Script to send mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sleep 60 | |
IP=`hostname -i` | |
HOSTNAME=`hostname -f` | |
echo "@reboot $HOSTNAME online. IP address: $IP" > /root/email.txt | |
echo >> /root/email.txt | |
date >> /root/email.txt | |
mail -s "$HOSTNAME online" [email protected] < /root/email.txt | |
rm -rf /root/email.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment