#!/bin/bash echo "---Checking if CLI password is specified---" if [ -z "${CLI_PASSWORD}" ]; then echo "---No CLI password found, creating---" CLI_PASSWORD="$(> ${DATA_DIR}/secret.txt SECRET="$(head ${DATA_DIR}/secret.txt)" else echo "---Secret found!---" SECRET="$(head ${DATA_DIR}/secret.txt)" fi else echo "---Secret manually specified, continuing---" fi AUTHENTICATION=" --use-auth-secret \ --static-auth-secret ${SECRET}" fi echo "---Preparing server---" chmod -R ${DATA_PERM} ${DATA_DIR} if [ "${DISPLAY_SECRETS}" == "true" ]; then echo "----------------------------------------------------------------------------------------" echo echo "AUTH-Secret: ${SECRET}" echo "CLI-Password: ${CLI_PASSWORD}" echo echo "----------------------------------------------------------------------------------------" fi echo "---Starting Server---" echo echo "-------------------------------------------------------------------------------------------------" echo "---Please ignore the following socket errors if you don't have configured IPv6 on your server!---" echo "-------------------------------------------------------------------------------------------------" echo turnserver --tls-listening-port ${PORT} \ --fingerprint \ ${AUTHENTICATION} \ --realm ${REALM} \ --total-quota ${TOTAL_QUOTA} \ --max-bps ${MAX_BPS} \ --stale-nonce \ --cert ${DATA_DIR}/${CERT_FILE} \ --pkey ${DATA_DIR}/${PRIVKEY_FILE} \ --cipher-list ${CIPHER_LIST} \ --no-multicast-peers \ --dh-file ${DATA_DIR}/${DH_FILE} \ --no-tlsv1 \ --no-tlsv1_1 \ --listening-ip ${LISTENING_IP} \ --cli-password=${CLI_PASSWORD} \ ${EXTERNAL_IP} \ ${EXTRA_PARAMS}