Subject: Re: bin/22981: rc.d/postfix doesn't check mailer.conf
To: None <>
From: Robert Elz <kre@munnari.OZ.AU>
List: source-changes
Date: 09/29/2003 04:58:52
    Date:        Sat, 27 Sep 2003 20:27:52 -0400 (EDT)
    From:        "James K. Lowden" <>
    Message-ID:  <>

  | +if [ "$1" = "start" ]
  | +then
  | +	grep /postfix/ /etc/mailer.conf >/dev/null || \
  | +		(MSG="$0: postfix started, but /etc/mailer.conf doesn't point to it.  See mailer.conf(5)."; \
  | +		 logger $MSG; \
  | +		 echo   $MSG )
  | +fi
  | +		

If you want to do this, which is probably a reasonable thing to do,
you probably also want to make sure that you're not finding the magic
string in a comment line.

So, perhaps make it be

	egrep '^[^#]*/postfix/' /etc/mailer.conf

It could also be a reasonable idea to use the -c option, and check
that there is more than one (probably at least about 3 or 4) postscript
lines in there before starting - or better check that at least the
"sendmail" line is there

	grep '^sendmail.*/postscript/'

There's also no real need for a subshell there, use { } for grouping
instead of ( ) and start it on the same line as the || and avoid the \
(the other two \'s aren't needed in any case).