diff options
author | Gordian Edenhofer | 2018-09-21 12:18:48 +0900 |
---|---|---|
committer | Gordian Edenhofer | 2018-09-21 12:18:48 +0900 |
commit | ac4ad4a016ba1886ace56fd43f0303a306e51b19 (patch) | |
tree | 9217e78add8d3c6faaa870e5f47a3b86d0347ab5 /minecraftd.sh | |
parent | b993177d837f4bf4312668109e3169cc7c6a45fd (diff) | |
download | aur-ac4ad4a016ba1886ace56fd43f0303a306e51b19.tar.gz |
upgpkg: minecraft-server 1.13.1-1
Broaden the scope of the regex which searches for active users in the
minecraftd.sh management script to include more escape sequences. This
notably enables using the idle_server part of the script in combination
with the 'Paper' minecraft server.
upgpkg: cuberite 1.12b975-2
upgpkg: spigot 1.12.2+b73-2
Diffstat (limited to 'minecraftd.sh')
-rwxr-xr-x | minecraftd.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/minecraftd.sh b/minecraftd.sh index 521ac2cde882..139bf66fca19 100755 --- a/minecraftd.sh +++ b/minecraftd.sh @@ -86,10 +86,10 @@ is_player_online() { # 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})?)?[m|K]//g' -e 's/.*\: //' | tr -d '\n' | wc -c) -le 1 ]]; then + 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 # 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})?)?[m|K]//g' -e 's/.*\: //' -e 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/' | tr -d '\n') -eq 0 ]]; then + 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 # No player is online return 0 else |