Skip to content

Instantly share code, notes, and snippets.

@simbalinux
Last active July 13, 2018 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simbalinux/2eeac0fb5ebe908f8d4b145a565778c0 to your computer and use it in GitHub Desktop.
Save simbalinux/2eeac0fb5ebe908f8d4b145a565778c0 to your computer and use it in GitHub Desktop.
restart_check
#!/bin/bash
#this is a coment for the code
set -x
sleep 60
IP=$(hostname -i)
HOSTNAME=$(hostname -f)
echo "$HOSTNAME online. IP address: $IP" > ./email.txt
date >> ./email.txt
tail ./email.txt | /usr/sbin/sendmail user@domain.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment