Skip to content

Instantly share code, notes, and snippets.

@bugyt
Last active January 26, 2016 08:37
Show Gist options
  • Save bugyt/110378e82252f8e5a88f to your computer and use it in GitHub Desktop.
Save bugyt/110378e82252f8e5a88f to your computer and use it in GitHub Desktop.
Script to send mail
#!/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