#!/usr/bin/with-contenv bash

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-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8088" \
        s6-setuidgid abc synclounge
