Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Minetest Server Tester
#!/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
You can’t perform that action at this time.