X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=blobdiff_plain;f=stump%2Fbin%2FprocessApproved;h=a62333ecd60c78160bccb07f5c239c2ebe745ee3;hb=68ea4a368d293b3d2cf0d470af817ec300fd3553;hp=9cdf3c6cead81535f081f2449edd3ceb27112abb;hpb=56d8a80761d68c123d55778d73b66268dabd3e34;p=modbot-mtm.git diff --git a/stump/bin/processApproved b/stump/bin/processApproved index 9cdf3c6..a62333e 100755 --- a/stump/bin/processApproved +++ b/stump/bin/processApproved @@ -1,4 +1,7 @@ -#!/bin/sh +#!/bin/bash + +set -ex +set -o pipefail NEWSBIN=/var/lib/newsbin; export NEWSBIN shift @@ -28,7 +31,12 @@ post() { ( echo Path: "$PATH_SUFFIX" - cat $MNG_ROOT/etc/added-headers | grep ': ' + perl <$MNG_ROOT/etc/added-headers -ne ' + next unless m/\:/; + s/\[REFERENCE\]/[$ENV{"WEBSTUMP_MESSAGENUM"}]/g + if defined $ENV{"WEBSTUMP_MESSAGENUM"}; + print or die $!; + ' # I do grep above because a lot of users inserts empty # lines in the added headers.