support for x2x and barrier KVM

This commit is contained in:
2021-10-10 00:09:37 +04:00
parent ce61920ec2
commit 0ed316cb5e
11 changed files with 831 additions and 814 deletions

10
run.sh
View File

@@ -1,11 +1,11 @@
# Starts server and runs it silently (i.e no output in the terminal)
./laplace -tls -addr 0.0.0.0:8888 > /dev/null 2>&1 &
./remotegameplay -tls -addr 0.0.0.0:${2} > /dev/null 2>&1 &
# Starts chromium browser and runs it silently (i.e no output in the terminal)
./laplace -headless -addr ${1} > /dev/null 2>&1 &
./remotegameplay -headless -addr ${1} -port ${2} > /dev/null 2>&1 &
# Lets the script sleep for 2 seconds
sleep 2
# Gets roomInfo and stores in the tmp directory as JSON
./laplace -headless -roomInfo > /tmp/output.txt
./remotegameplay -headless -roomInfo > /tmp/output.txt
# Gets the room ID from the JSON file and outputs to tmp directory as text
jq .id /tmp/output.txt > /tmp/test.txt
# Gets roomID from tmp directory as text
@@ -15,9 +15,9 @@ roomID=$(echo "$roomID" | tr -d '"')
# Checks if the IP address is a IPV6 or IPV4 address
if [ "$1" != "${1#*[0-9].[0-9]}" ]; then
echo "https://"${1}":8888/?roomID="${roomID}
echo "https://"${1}":${2}/?roomID="${roomID}
elif [ "$1" != "${1#*:[0-9a-fA-F]}" ]; then
echo "https://["${1}"]:8888/?roomID="${roomID}
echo "https://["${1}"]:${2}/?roomID="${roomID}
else
echo "Unrecognized IP format '$1'"
fi