#!/usr/bin/with-contenv bash
# shellcheck shell=bash

if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
    exec \
        s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 6767" \
            cd /app/bazarr/bin s6-setuidgid abc python3 /app/bazarr/bin/bazarr.py --no-update --config /config
else
    exec \
        s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 6767" \
            cd /app/bazarr/bin python3 /app/bazarr/bin/bazarr.py --no-update --config /config
fi
