@carey I think I found the bug; I made a mistake during a string comparison. The following change should fix the observed problem:
@@ -82,14 +82,16 @@ game_command() {
# Check whether there are player on the server through list
is_player_online() {
response="$(sleep_time=0.6 return_stdout=true game_command list)"
+ # Delete leading line and free response string from fancy characters
+ response="$(echo "${response}" | sed -r -e '$!d' -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[JKmsuG]//g')"
# The list command prints a line containing the usernames after the last occurrence of ": "
# and since playernames may not contain this string the clean player-list can easily be retrieved.
# Otherwiese check the first digit after the last occurrence of "There are". If it is 0 then there
# are no players on the server. Should this test fail as well. Assume that a player is online.
- if [[ $(echo "${response}" | grep ":" | sed -r -e '$!d' -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[JKmsuG]//g' -e 's/.*\: //' |
tr -d '\n' | wc -c) -le 1 ]]; then
+ if [[ $(echo "${response}" | grep ":" | sed -e 's/.*\: //' | tr -d '\n' | wc -c) -le 1 ]]; then
# No player is online
return 0
- elif [[ $(echo "${response}" | grep "There are" | sed -r -e '$!d' -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[JKmsuG]//g' -e 's/.*\: //' -e 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/' | tr -d '\n') -eq 0 ]]; then
+ elif [[ "x$(echo "${response}" | grep "There are" | sed -r -e 's/.*\: //' -e 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/' | tr -d '\n')" == "x0" ]]; then
# No player is online
return 0
else
The first check should always have reported that there are indeed players online but the second check probably passed without being supposed to do so. This should now be fixed. I would be thrilled if you could test the change and report back to me, whether this indeed solved the problem. If it does, I will roll out the change immediately.
Pinned Comments
edh commented on 2019-11-28 22:17 (UTC)
Unfortunately, upstream does not really have proper releases but instead points to build-versions of the software. Note, I will not push every new build of the package to the AUR but I will update the package upon new minecraft releases, e.g. for 1.14.4 to 1.14.5.
edh commented on 2016-12-11 20:51 (UTC)