#!/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##*:}" \ "$@"