From 88727f30483ec0b7325526b317df226567bc5a6b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 21 Jan 2014 17:12:42 +0000 Subject: [PATCH] install-rejectionreasons: new script --- install-rejectionreasons | 34 ++++++++++++++++++++++++++++++++++ setup | 1 + 2 files changed, 35 insertions(+) create mode 100755 install-rejectionreasons diff --git a/install-rejectionreasons b/install-rejectionreasons new file mode 100755 index 0000000..39c41d9 --- /dev/null +++ b/install-rejectionreasons @@ -0,0 +1,34 @@ +#!/bin/bash +set -e + +. ./get-settings + +in=$BASEDIR/stump/etc/messages +out=$BASEDIR/public-html/rejection-reasons + +exec 3<$BASEDIR/webstump/config/newsgroups/$GROUP/rejection-reasons + +mkdir -p $out + +install_rr () { + rm -f "$out/$1" + file="$out/$1.txt" + exec 4>"$file.new" + printf >&4 "%s - %s\n\n" "$1" "$2" + cat >&4 "$in/$1" + mv -f "$file.new" "$file" + touch "$out/.want.$1.txt" +} + +install_rr "charter" "not in accordance with the charter" + +while read line <&3; do + install_rr "${line%%::*}" "${line#*::}" +done + +cd $out +for was in *.txt; do + if ! test -f ".want.$was"; then + rm "$was" + fi +done diff --git a/setup b/setup index bf60575..2e78fb1 100755 --- a/setup +++ b/setup @@ -15,6 +15,7 @@ x ./install-substitutions x make -C webstump x ./install-aggregates x ./install-weblinks +x ./install-rejectionreasons x ./install-loggroups echo ==== DONE ==== -- 2.30.2