Skip to content

Instantly share code, notes, and snippets.

@rubenwardy
Last active July 12, 2019 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenwardy/08a0a6770d637265e4d1947f784e600b to your computer and use it in GitHub Desktop.
Save rubenwardy/08a0a6770d637265e4d1947f784e600b to your computer and use it in GitHub Desktop.
#!/bin/bash
find_minetest() {
MT_DIR=$(pwd)
while [[ $(basename "$MT_DIR") != "minetest" ]]
do
MT_DIR=$(dirname "$MT_DIR")
done
MT=${MT_DIR}/bin/minetest
echo "Found minetest at: $MT_DIR"
}
start_server() {
echo "Starting server"
$MT --server --port 30000 --world "${MT_DIR}/worlds/edu" --name "teacher1" &
}
start_client() {
echo "Starting client $1"
$MT --address "127.0.0.1" --port 30000 --name "$1" --password "pass" --go &
}
start_headless_client() {
echo "Starting headless client $1"
xvfb-run $MT --address "127.0.0.1" --name $1 --password "pass" --go &
}
find_minetest
build_conf
start_server
start_headless_client student1
start_headless_client student2
start_headless_client student3
start_headless_client student4
start_headless_client student5
start_headless_client student6
start_client teacher1
read -n 1 -s -r -p "Press any key to continue"
killall minetest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment