HEX
Server: Apache
System: FreeBSD www860.sakura.ne.jp 13.0-RELEASE-p14 FreeBSD 13.0-RELEASE-p14 #2: Mon Dec 9 13:54:55 JST 2024 root@www5301.sakura.ne.jp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
User: yoyo0427 (1306)
PHP: 8.3.8
Disabled: NONE
Upload Files
File: //usr/local/sbin/sharedindexinstall
#! /bin/sh
#
# Copyright 2004 Double Precision, Inc.
# See COPYING for distribution information.
#
# Sample script to safely update shared folder index files.

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

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"