Skip to content

Instantly share code, notes, and snippets.

@vonthecreator
Last active August 11, 2020 21:41
Show Gist options
  • Save vonthecreator/703d4c047b173c824e353ebac40946fb to your computer and use it in GitHub Desktop.
Save vonthecreator/703d4c047b173c824e353ebac40946fb to your computer and use it in GitHub Desktop.
Sends and email with local host IP & SSH port when a WIFI connection is established.
SERVER_PORT=$(head -n13 /etc/ssh/sshd_config | grep "Port" | awk '{print $2}')
SERVER_IP=$(hostname -I | awk '{ print $1 }')
swaks --to [email protected] -s smtp.gmail.com:587 -tls -au [email protected] -ap PASSWORD --header "Subject: [PING] raspy $(date)" --body "IP: $SERVER_IP \nPORT: $SERVER_PORT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment