| Summary: | daily periodic: [: /var/log/maillog.10.gz: unexpected operator | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Andre Albsmeier <Andre.Albsmeier> |
| Component: | conf | Assignee: | Brian Somers <brian> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.1-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Andre Albsmeier
2000-08-10 05:50:01 UTC
On Thu, 10 Aug 2000 06:49:28 +0200, Andre Albsmeier wrote:
> If you have more than 9 /var/log/maillog.*.gz files, 460.status-mail-rejects
> complains:
>
> Checking for rejected mail hosts:
> [: /var/log/maillog.10.gz: unexpected operator
That's because this test is broken:
[ -f /var/log/maillog.$n* ]
One possible solution is as follows:
Index: 460.status-mail-rejects
===================================================================
RCS file: /home/ncvs/src/etc/periodic/daily/460.status-mail-rejects,v
retrieving revision 1.10
diff -u -d -r1.10 460.status-mail-rejects
--- 460.status-mail-rejects 2000/06/30 09:41:15 1.10
+++ 460.status-mail-rejects 2000/08/10 10:27:40
@@ -24,7 +24,13 @@
{
while [ $n -ge 0 ]
do
- [ -f /var/log/maillog.$n* ] && zcat -fc /var/log/maillog.$n*
+ if [ -f /var/log/maillog.$n ]
+ then
+ cat -c /var/log/maillog.$n
+ elif [ -f /var/log/maillog.$n.gz ]
+ then
+ zcat -c /var/log/maillog.$n.gz
+ fi
n=$(($n - 1))
done
cat /var/log/maillog
This'll work fine until periodic(8) supports alternative compression
mechanisms.
Ciao,
Sheldon.
Responsible Changed From-To: freebsd-bugs->brian I've proposed a patch. Over to the maintainer. State Changed From-To: open->closed A fix has been committed to -current and (rather prematurely) to -stable. |