-
-
Save rubenwardy/08a0a6770d637265e4d1947f784e600b to your computer and use it in GitHub Desktop.
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 | |
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