X-Git-Url: https://git.donarmstrong.com/?p=spamassassin_config.git;a=blobdiff_plain;f=update_spamassassin;h=59ab92e4d858f1a2f623b05993dbac6454259a7a;hp=1a8c41af509e62a5a3979f996ab623420c9ed5d5;hb=11ce2b1ce79fb3fde1e9b1a5b2388e4fcd3cac4b;hpb=78451f010ae602d7b3accdd95eec57ed79b1fc77 diff --git a/update_spamassassin b/update_spamassassin index 1a8c41a..59ab92e 100755 --- a/update_spamassassin +++ b/update_spamassassin @@ -28,7 +28,7 @@ ORIGREV=$(svn info $SACONFIG |awk '/^Revision:/{print $2}') NEWREV=$(svn info $(svn info $SACONFIG|awk '/^URL:/{print $2}')|awk '/^Revision:/{print $2}') # no changes, bug out. -if [ $ORIGREV -ge $NEWREV ]; +if [ $ORIGREV -ge $NEWREV ]; then exit 0; fi; @@ -52,10 +52,16 @@ function report_failure(){ if [ -e "$SACONFIG/failed_update" ]; then exit 0; fi; - echo "$FAILURE_MESSAGE" >> "$SACONFIG/failed_update" - echo "$FAILURE_MESSAGE"; - echo - echo "update_spamassassin will not report any additional errors until this is fixed" + echo "$FAILUREMESSAGE" >> "$SACONFIG/failed_update" + echo "$FAILUREMESSAGE"; + cat - </dev/null 2>&1 -FAILUREMESSAGE="$(spamassassin -C $TMPDIR/spamassassin_config/$USERCONF --lint)" -if [ "$?" != "0" ]; then - FAILUREMESSAGE="$(echo -e 'spamassassin -C $TMPDIR/spamassassin_config/$USERCONF --lint\nfailed with\n')$FAILUREMESSAGE"; +if ! spamassassin -C $TMPDIR/spamassassin_config/$USERCONF --lint > $TMPDIR/sa_lint 2>&1; then + FAILUREMESSAGE="$(echo -e 'spamassassin -C $TMPDIR/spamassassin_config/$USERCONF --lint\nfailed with\n'| cat - $TMPDIR/sa_lint)"; report_failure fi; mv "$SACONFIG" "$BAKDIR/spamassassin_config_r$ORIGREV" mv "$TMPDIR/spamassassin_config" "$SACONFIG" trap ERR +remove_pidfile rm -rf "$TMPDIR" if [ "$HOSTNAME" == "rietz" ]; then @@ -89,4 +95,4 @@ else fi; -exit 0; \ No newline at end of file +exit 0;