home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # queued <frequency> <manager>
- # Daemon to process the mail queue periodically. The frequency is given
- # in seconds.
-
- if [ $# -ne 2 ]; then
- echo Usage: `basename $0` \<frequency\> \<manager\>
- exit 3
- fi
- DIR=/usr/server/mqueue
- FREQ=$1
- MANAGER=$2
- shift; shift
- if [ ! -d $DIR ]; then
- echo $DIR directory missing
- exit 3
- fi
- cd $DIR
- PWD=`pwd`
- while [ 007 ]; do
- for i in `\ls`
- do
- if [ ! -r /usr/server/pqueue ]; then
- echo queued aborts: pqueue not found | /bin/rmail $MANAGER
- exit 1
- fi
- /usr/server/pqueue -e $PWD/$i
- if [ $? -gt 0 ]; then
- echo queued aborts: pqueue exit status $? | /bin/rmail $MANAGER
- exit 1
- fi
- done
- sleep $FREQ
- done
- exit 0
-