Created
March 20, 2013 23:18
-
-
Save inertia186/5209427 to your computer and use it in GitHub Desktop.
[Minecraft, SMP] Planet Minecraft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MC="/Users/steve/Minecraft" | |
LOG="$MC/server.log" | |
MESSAGE="We are not falling for it. This is not the server you are looking for. Move along." | |
for player in `tail -50 $LOG | grep -i "i'm\|im\|i am" | grep -i from | grep -i planet | grep -i minecraft | cut -f 4 -d " " | cut -f 2 -d \< | cut -f 1 -d \> | sort | uniq` | |
do | |
if [ -n "`tail -100000 $LOG | grep "Kicked $player from the game: '$MESSAGE'"`" ]; then | |
echo Skipping $player, already kicked. | |
else | |
query=`$MC/scripts/Dinnerbone-mcstatus-a24e563/cli.py uniblab.local | grep -i $player | wc -l` | |
query=$(sed -e 's/^[[:space:]]*//' <<<"$query") | |
if [ $query -eq 0 ]; then | |
echo Skipping $player \(logged out?\). | |
else | |
cmd="kick $player $MESSAGE" | |
bash -c "screen -p 0 -S minecraft -X eval 'stuff \"$cmd\"\015'" | |
echo $cmd | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment