-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is required on certain machines (eg the iSH emulator on iOS)
- Loading branch information
1 parent
b02201d
commit 58a7a86
Showing
1 changed file
with
3 additions
and
0 deletions.
There are no files selected for viewing
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
58a7a86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this.
I am trying to set up a script that monitors the number of users in my server every minute, running with cron.
My first setup was simply adding
/opt/minecraft/tools/mcrcon/mcrcon -p password "list" | head -n1
to the script and reading the output. However, a problem with that is that it adds two new lines to the server log every time it runs, and over the course of a day it gets very spammy.I then managed to open an rcon session in tmux, then redirect the output to a file, and send commands using
tmux send-keys -t 0 list
. However, this showed another problem - the output is only written to disk after I kill mcrcon.I was about to file a bug report but then I found your fix, and while I couldn't figure out how to clone it or merge it onto my copy of the repo, I did manage to simply edit the mcrcon.c file and add the fflush(stdout); lines where you placed them. This worked like a charm.
Hope you have a wonderful day.
58a7a86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unicodepepper I’m glad I could help :)