HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/lib/courier-imap/sbin/sharedindexinstall
#! /bin/sh
# $Id: sharedindexinstall.in,v 1.1 2004/01/11 02:47:33 mrsam Exp $
#
# Copyright 2004 Double Precision, Inc.
# See COPYING for distribution information.
#
# Sample script to safely update shared folder index files.

prefix="/usr/lib/courier-imap"
sysconfdir="/usr/lib/courier-imap/etc"

shareddir="$sysconfdir/shared"  # Where the shared index files are kept

newshareddir="$sysconfdir/shared.tmp" # Updated shared index

if test `ls "$newshareddir" | wc -l` = 0
then
	echo "$newshareddir is empty!"
	exit 1   # Sanity check
fi

if test ! -d "$shareddir"
then
	echo "$shareddir does not exist!"
	exit 1
fi

# First, remove obsoleted files

ls "$shareddir" | while read F
do
	test -f "$newshareddir/$F" || rm -f "$shareddir/$F"
done

mv -f "$newshareddir"/* "$shareddir"