Linux awk script to determine who joined your server...

Discussion in 'Bukkit Tools' started by palisade, Apr 3, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    palisade

    I cooked up the following script to help me figure out who's been jumping on my server, historically speaking. Instead of displaying who happens to be online right now, this script instead displays who has logged in entirely since the server started. NOTE: Change the MCLOGPATH to where your server.log is located. You could also glance inside the world/players path and see who has logged into your server, but you won't be able to tell who logged in during a specific run of your server. For example, say you just started hosting the new patch and you want to see the name of everyone who has tried it out.

    Drop the following code block in a file called whojoined:

    Code:
    #!/bin/sh
    MCLOGPATH=$HOME/mc/server.log
    awk '/logged in/{if(!a[$4]++)print $4}' $MCLOGPATH
    Then place it in your home bin directory and then type:
    chmod +x whojoined

    And, now you can type:
    whojoined

    And see a list of names of players who joined your server since it last started logging. If your script, e.g. ABM, supports truncating the server.log each time the server is run and rolling the old ones into a logs directory then you'll be able to determine who has jumped on your server since your last server restart. If not, then it'll be all time or since you last deleted your server.log file.

    This script also excludes duplicate names.

    Just thought someone else out there might find this useful.
     
Thread Status:
Not open for further replies.

Share This Page