Skip to content

Instantly share code, notes, and snippets.

@jakobrs
Created March 13, 2020 18:42
Show Gist options
  • Save jakobrs/27192a20516085f1ae66f2ec7d9e5453 to your computer and use it in GitHub Desktop.
Save jakobrs/27192a20516085f1ae66f2ec7d9e5453 to your computer and use it in GitHub Desktop.
#!/usr/bin/env nix-shell
#! nix-shell -p jq -i bash
# Usage:
# ./script.sh <server name> <delay>
echo "Monitoring $1 with $2 seconds delay between checks"
while true; do
date | tr '\n' ' '
mcstatus "$1" json | jq '.players | map(.name)' -c
sleep "$2"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment