Skip to content

Instantly share code, notes, and snippets.

@TobiX
Created April 30, 2011 23:19
Show Gist options
  • Save TobiX/950083 to your computer and use it in GitHub Desktop.
Save TobiX/950083 to your computer and use it in GitHub Desktop.
Minecraft Authentication
#!/bin/sh
user=$1
pass=$2
echo "Login..."
oldIFS="$IFS"
IFS=':'
set -- `curl -d "user=$user&password=$pass&version=9999" https://login.minecraft.net/`
IFS="$oldIFS"
if [ $# -ne 4 ]
then
echo "ERR: $@"
exit 1
fi
sid=$4
user=$3
hash=$RANDOM
echo "Now I'm the client ($user)..."
curl -L "http://www.minecraft.net/game/joinserver.jsp?user=$user&sessionId=$sid&serverId=$hash"
echo
echo "Now I'm the server..."
curl -L "http://www.minecraft.net/game/checkserver.jsp?user=$user&serverId=$hash"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment