watch_mdbox

A script to check for changes in dovecot (m)dbox folders.
git clone git://r-36.net/watch_mdbox
Log | Files | Refs | LICENSE

commit 8f8a46fe8955aa2c57bb4b6685a59aecb6c30c06
parent 235cc6ba7e9e2571d550c94079d9de5567e44456
Author: Christoph Lohmann <20h@r-36.net>
Date:   Thu, 30 Jun 2011 17:30:44 +0200

Makring watch_mdbox real sh compatible.

Diffstat:
Makefile | 4++++
bin/watch_mdbox | 8++++----
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,6 +3,9 @@ include config.mk +all: + @echo watch_mdbox is just a script, so there is only make install left. + dist: @echo creating dist tarball @mkdir -p watch_mdbox-${VERSION} @@ -23,3 +26,4 @@ uninstall: @rm -f ${DESTDIR}${PREFIX}/bin/watch_mdbox .PHONY: dist install uninstall + diff --git a/bin/watch_mdbox b/bin/watch_mdbox @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh delimiter="." -if [ "$1" == "" ]; +if [ "$1" = "" ]; then mdboxroot="$HOME/mdbox" else @@ -25,10 +25,10 @@ do mailbox=`echo $status | \ sed "s,^${mailboxes}/\(.*\)/dbox-Mails/$,\1,g"`; mailbox=`echo $mailbox | sed "s,/,${delimiter},g"`; - if [ "$mailbox" == "$omailbox" ]; + if [ "$mailbox" = "$omailbox" ]; then ntime=`date +%s` - difft=$[$ntime - ($otime + 1)] + difft=$(($ntime - ($otime + 1))) if [ $difft -gt 0 ]; then otime=`date +%s`