Skip to content

Instantly share code, notes, and snippets.

View crischutu07's full-sized avatar

Nguyễn Hồng Sơn crischutu07

  • Hanoi, Vietnam
View GitHub Profile
#!/usr/bin/env bash
# mcping - Minecraft server ping written in Bash
# This Bash script uses only `netcat` to ping a Minecraft server. (because my device doesn't support /dev/tcp)
# Unfortunately, netcat is not capable of closing TCP connection when it recieves the data from the server
# so either you Ctrl-C this script or wait for 30 seconds until netcat automatically end itself. (because of "timed out")
# Author: Nguyen Hong Son <cris@crischu07.is-a.dev>
if [ -z "$@" ]; then
echo "Usage: $0 [<address>] <port> <version>"