1 |
#!/bin/sh |
2 |
# |
3 |
# $NetBSD: sharedindexupdate.sh,v 1.2 2005/02/18 22:12:50 jlam Exp $ |
4 |
# $FreeBSD: /tmp/pcvs/ports/mail/courier/files/sharedindexupdate.in,v 1.1 2006-02-14 12:00:05 lawrance Exp $ |
5 |
# |
6 |
# This script updates the index of shared folders on the system and is |
7 |
# only needed if Courier-IMAP or SqWebMail used to serve mail and shared |
8 |
# folders are used. If so, then this script should be run regularly as a |
9 |
# system process to ensure the shared folder index is kept up-to-date. |
10 |
# |
11 |
# The courier-authlib package must be separately installed to provide the |
12 |
# "authenumerate" program used in this script. |
13 |
|
14 |
prefix="%%PREFIX%%" |
15 |
exec_prefix="${prefix}" |
16 |
sysconfdir="${prefix}/etc/courier" |
17 |
sbindir="${exec_prefix}/sbin" |
18 |
|
19 |
rm -rf ${sysconfdir}/shared.tmp |
20 |
mkdir ${sysconfdir}/shared.tmp || exit 1 |
21 |
|
22 |
test -x ${sbindir}/authenumerate || exit 1 |
23 |
${sbindir}/authenumerate > ${sysconfdir}/shared.tmp/.tmplist || exit 1 |
24 |
${sbindir}/sharedindexsplit ${sysconfdir}/shared.tmp 1 < ${sysconfdir}/shared.tmp/.tmplist || exit 1 |
25 |
rm -f ${sysconfdir}/shared.tmp/.tmplist |
26 |
${sbindir}/sharedindexinstall |