53 lines · 2.1 KB · Text
RawDownload
#!/bin/shif [ -z "$1" ] || [ -z "$2" ]; then	echo "new-server {name} {base-port}"	echo	echo "Sets up a new Overte server with the specified name and base port number"	echo "  {name} - a simple name used to identify the server to scripts (not used in the server configuration)"	echo "  {base-port} - the base port number (default server is 40100).  The domain server port will be {base-port}+2"	echo "                Four contiguous port numbers are allocated, these must not overlap with other running services on this machine"	echo	echo "Launching a server created by this script is done with:"	echo "  sudo systemctl start overte-server@{name}.target"	echo	exit 1fi if [ "$(id -u)" -ne 0 ]; then	echo "new-server {name} {base-port}"	echo	echo 'This script must be run by root' >&2	exit 1fi if [ -d "/var/lib/overte/$1" ]; then	echo "Path /var/lib/overte/$1 already exists"	echo	echo "Please remove this path first if you wish to recreate this server"	exit 2fi mkdir -p /var/lib/overte/$1/.local/share# Old development builds.ln -s ../.. /var/lib/overte/$1/.local/share/Overte\ -\ devln -s ../.. /var/lib/overte/$1/.local/share/Overte\ -\ PRln -s ../.. /var/lib/overte/$1/.local/share/Overte\ -\ Devln -s ../.. /var/lib/overte/$1/.local/share/Overte\ -\ Nightlyln -s ../.. /var/lib/overte/$1/.local/share/Overtemkdir -p /var/lib/overte/$1/domain-serverecho "{\"metaverse\": {\"local_port\": $(($2 + 2))},\"version\": 2.4}" > /var/lib/overte/$1/domain-server/config.jsonchown -R overte.overte /var/lib/overte/$1 echo HIFI_DOMAIN_SERVER_HTTP_PORT=$2 > /etc/opt/overte/$1.confecho HIFI_DOMAIN_SERVER_HTTPS_PORT=$(($2 + 1)) >> /etc/opt/overte/$1.confecho HIFI_DOMAIN_SERVER_PORT=$(($2 + 2)) >> /etc/opt/overte/$1.confecho HIFI_DOMAIN_SERVER_DTLS_PORT=$(($2 + 3)) >> /etc/opt/overte/$1.conf echo "A new Overte server has been created with the name of '$1'"echoecho "To launch it:"echo "  sudo systemctl start overte-server@$1.target"echo "To have it launch at system start:"echo "  sudo systemctl enable overte-server@$1.target"echo "The server configuration console is available at:"echo "  http://localhost:$2"