Skip to content

Instantly share code, notes, and snippets.

@alkalinecoffee
Last active September 3, 2018 13:05
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 alkalinecoffee/3fbabfc6914aade0e3c44ecf90de0233 to your computer and use it in GitHub Desktop.
Save alkalinecoffee/3fbabfc6914aade0e3c44ecf90de0233 to your computer and use it in GitHub Desktop.
#!/bin/sh
# wget -qO- http://mywebsite.com/myscript.txt | bash -s phone-number username64 password64
to=$1
username64=$2
password64=$3
attempts=2
ip=192.168.1.234
output=$(ping -w$attempts $ip)
if [[ $output = *"0 packets received"* ]]; then
echo "$ip is offline!"
(
echo "EHLO localhost"; sleep 1;
echo "auth login"; sleep 1;
echo "$username64"; sleep 1;
echo "$password64"; sleep 1;
echo "mail from:<$to@vtext.com>"; sleep 1;
echo "rcpt to:<$to@vtext.com>"; sleep 1;
echo "Data"; sleep 1;
echo "From: <$tovtext.com>"; sleep 1;
echo "To: <$to@vtext.com"; sleep 1;
echo "Subject:"; sleep 1;
echo " "; sleep 1;
echo "Wifi device $ip is offline"; sleep 1;
echo "."; sleep 1;
echo "quit"
) | openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof
else
echo "$ip online"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment