chiark / gitweb /
More error handling: set -e, set -o pipefail
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Feb 2010 21:18:40 +0000 (21:18 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Feb 2010 21:18:40 +0000 (21:18 +0000)
14 files changed:
stump/bin/noAck
stump/bin/preApprove
stump/bin/processApproved
stump/bin/processRejected
stump/bin/report.sh
stump/bin/send_pgp_key
stump/bin/stump-pgp
stump/bin/submitFailed
stump/bin/verifySignature
stump/etc/modack.approved.INO
stump/etc/modack.received.INO
stump/etc/mods-message
stump/etc/my_rnews
stump/etc/posted_log

index 8fde0a5a33ec27b1f05dc43c03c4c038b14a6f8d..e0ca66fb97af01456ea3331529a495d814db0708 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 if [ "x$@" = "x" ]; then
 
   cat >> $MNG_ROOT/data/noack.list
index bb0baa5b95a80a1a43eccc5ed09813437b37f55a..e9ab9d43391ac95b59eb166d5221cd9b946b30b2 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 if [ "x$@" = "x" ]; then
 
   cat >> $MNG_ROOT/data/good.guys.list
index 9cdf3c6cead81535f081f2449edd3ceb27112abb..615d0c17ccee00bd12715f9409c20f9fcdfcb51e 100755 (executable)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
 
 NEWSBIN=/var/lib/newsbin; export NEWSBIN
 shift
index c2dbc5ea071619e723e90d5d6d2c134634076316..460c25adf13888e3539c26e191760a401b14748d 100755 (executable)
@@ -4,6 +4,8 @@
 # reply message, signs it with PGP and sends back to the author.
 #
 
+set -e
+
 # echo $0 invoked with arguments $@ 1>&2
 
 MESSAGE=$TMP/rejected.$$
index 13138f1a2f9850159fc2f3e8c607def6e7639eb9..966d083e9de54926844e86dfc7000e3349e62d17 100755 (executable)
@@ -1,9 +1,12 @@
-#!/bin/sh
+#!/bin/bash
 # posts a nice report
 #
 # $Id: report.sh,v 1.2 2007/05/03 23:47:49 rram Exp $
 # Modified to work with GPG
 
+set -e
+set -o pipefail
+
 TODAY="`date`"
 DATE6="`date +%y%m%d`"
 
index 4104f1bdcb19a531d7eee141dca6a31c37a682a3..0e1decdbffec7e54b7b20fb95b932beb0427440b 100755 (executable)
@@ -1,4 +1,8 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
+
 (
   formail -r -I "Subject: $NEWSGROUP Approval PGP Key" \
          -I "Reply-To: devnull@algebra.com"            \
index 05425d369dc4b0ffc42c958040564abfd59841cf..2c07e6414cc338ebc66b861ee8deec9c7cc5a987 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
 
 # $Id: stump-pgp,v 1.2 2007/05/03 23:47:55 rram Exp $
 # Modified to work with GPG
index 938d341f27d77bbb0d5da2520cb0752f237c3a9b..43bc12688a0112c46de419589858b25e6cd689a6 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
 
 cd $MNG_ROOT/tmp
 
index 45571a39d5f92d51b45e5048eea83706cde622c5..c719d017e3e113d88b7318a4a523496494ac033a 100755 (executable)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
 
 # $Id: verifySignature,v 1.2 2007/05/03 23:50:21 rram Exp $
 # Modified to work with GPG
index d07d7609928d6115693791f03b3651b790775e6e..17f9717a1194c48f0e0148327b7a205653541150 100755 (executable)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
 
 (
   cat $@ | formail -rt -I "Reply-To: $NOACK" \
index 63be1104f494b1b6222fb6786deeea3375f1beaf..f666c0b6b4b45922c7198d6c8717470f337bb44a 100755 (executable)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
 
 TMPFILE=$TMP/reply.$$
 
index 3d3c4c73d3aa7594e2a2e3e3a9c18f09c9201146..ddc73d6db9e8dbd4b1fa85ab0b0212b5a16fa8bc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # This script sends an email to a group of people listed in
 # env var RECIPIENTS (we create this var here from etc/moderators)
@@ -7,6 +7,9 @@
 # human moderators of your newsgroup.
 #
 
+set -e
+set -o pipefail
+
 FILTER="NO_$2_LIST";
 
 RECIPIENTS="`cat $MNG_ROOT/etc/moderators \
index 8ba5f13d8785858109c3ecabb50f32e79def3902..86c5894482b4b8612f63e1879947ca8164dcd6a6 100755 (executable)
@@ -1,9 +1,11 @@
-#!/bin/sh
+#!/bin/bash
 #
 # use this script instead of standard rnews or inews, if you want better
 # propagation of your articles.
 #
 
+set -e
+
 TEMPFILE=$TMP/posting.$$
 
 cat $@ > $TEMPFILE
index 0f48c6c1e935e1d0f932a7dc26d24794f32dda69..08c8e5aa7e8bcb2ba347adca6b03c7d29c7f54c3 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
 
 # This file creates a little .posted_log file in your home 
 # directory. Runs if activeated by crontab. See your crontab