Makring watch_mdbox real sh compatible. - watch_mdbox - A script to check for changes in dovecot (m)dbox folders.
       
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 8f8a46fe8955aa2c57bb4b6685a59aecb6c30c06
 (DIR) parent 235cc6ba7e9e2571d550c94079d9de5567e44456
 (HTM) 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(-)
       ---
 (DIR) 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
       +
 (DIR) diff --git a/bin/watch_mdbox b/bin/watch_mdbox
       @@ -1,8 +1,8 @@
       -#!/bin/bash
       +#!/bin/sh
        
        delimiter="."
        
       -if [ "$1" == "" ];
       +if [ "$1" = "" ];
        tthen
                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`