Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple Minecraft server notifier using lsof and ssmtp to check for active player conections and send an email if players have logged in to the server since the last check.
message="Someone has logged in to the Minecraft server"
if [ -s .players ]; then
lsof -iTCP:25565 -sTCP:ESTABLISHED > .players
lsof -iTCP:25565 -sTCP:ESTABLISHED > .players && echo "$message" | /usr/sbin/ssmtp "$email"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.