Created
February 9, 2019 22:02
-
-
Save GreenXenith/a0bdb9c4d6226c1de9a59415802c850f to your computer and use it in GitHub Desktop.
Minetest Server Tester
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
#!/bin/bash | |
COUNT=0 | |
while [[ $COUNT -ne 50 ]]; do | |
# Run minetest directly to server and free terminal input (&) | |
./minetest --go --address 123.456.78.9 --port 30000 --name 'LoadTester'$COUNT --password 'password123' & | |
# Record PID | |
PID=$! | |
sleep 0.5 | |
# Get window id | |
while [ "$WID" == "" ]; do | |
WID=$(wmctrl -lp | grep $PID | cut "-d " -f1) | |
done | |
# Rename window (to avoid title conflicts on next id search - this could be done better) | |
wmctrl -r 'Minetest 5.0.0-dev-b7e1bca2-dirty [Main Menu]' -N 'LoadTester'$COUNT | |
# Unmaximize window and resize to 0 | |
wmctrl -i -r $WID -b remove,maximized_vert; wmctrl -i -r $WID -b remove,maximized_horz;wmctrl -i -r $WID -e 0,0,0,0,0 | |
# Increment and wait to not choke | |
((COUNT++)) | |
sleep 3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment