From 77ac83e700415cdbd4635eae91e79f99312ea240 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Wed, 30 Aug 2023 10:29:47 -0600 Subject: Initial commit * iris support copied in from iris-news * a new slog backend * "metabackend" wraps and routes between multiple backends based on the groups they support * better logging than iris-news ever had --- script/with-metanews | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 script/with-metanews (limited to 'script/with-metanews') diff --git a/script/with-metanews b/script/with-metanews new file mode 100755 index 0000000..7d1e8cc --- /dev/null +++ b/script/with-metanews @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +if [[ -z "$METANEWS_LOG" ]]; then + METANEWS_LOG="/dev/null" +fi + +$(dirname $0)/metanews >>"$METANEWS_LOG" 2>/dev/null & +serverpid="$!" + +while [[ ! -e ~/.metanews-server ]]; do + sleep 0.1 +done +addr="$(cat ~/.metanews-server)" + +function cleanup { + rm ~/.metanews-server + tail --pid $serverpid -f /dev/null +} +trap cleanup EXIT + +env \ + NNTPSERVER="${addr%%:*}" \ + NNTPPORT="${addr##*:}" \ + "$@" -- cgit v1.2.3