#!/usr/bin/with-contenv bash

if [ "${AUTOJOIN_ENABLED}" == "true" ]; then
	export autojoin__room="${AUTOJOIN_ROOM}"
fi
if [ -n "${AUTH_LIST}" ]; then
	export authentication__mechanism='["plex"]'
	export authentication__type='["server", "user"]'
	export authentication__authorized="[\"$(echo ${AUTH_LIST} | sed 's|,|", "|g')\"]"
fi

exec \
	s6-setuidgid abc synclounge
