Created
February 17, 2013 20:04
-
-
Save inertia186/4973141 to your computer and use it in GitHub Desktop.
[Minecraft, SMP] Tells uptime to all ops who are logged in.
This file contains 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
MC="/Users/steve/Minecraft" | |
for player in `cat $MC/ops.txt` | |
do | |
query=`$MC/scripts/Dinnerbone-mcstatus-a24e563/cli.py localhost | grep -i $player | wc -l` | |
query=$(sed -e 's/^[[:space:]]*//' <<<"$query") | |
if [ $query -eq 0 ]; then | |
echo Skipping $player, not logged in. | |
else | |
cmd="tell $player `uptime`" | |
echo $cmd | |
bash -c "screen -p 0 -S minecraft -X eval 'stuff \"$cmd\"\015'" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The query is performed by: https://github.com/Dinnerbone/mcstatus