2025-02-08 02:54:01 -08:00

19 lines
479 B
Plaintext
Executable File

#!/command/with-contenv sh
if [ -z "$WHITELIST_FEED_URL" ]; then
echo "Error: WHITELIST_FEED_URL is not set" >&2
exit 1
fi
mkdir -p /var/run/opentracker
## Create FIFO only if it doesn't already exist
if [ ! -p /var/run/opentracker/adder.fifo ]; then
mkfifo -m a+rw /var/run/opentracker/adder.fifo
fi
## Download torrent whitelist from BrightWeb.Torrents
curl -sS --request GET --header "accept: text/plain" --url "$WHITELIST_FEED_URL" -o /etc/opentracker/whitelist