summaryrefslogtreecommitdiffstats
path: root/sqwebmail/html/mksoftlinks
blob: 9dbf7e0374ea07ce6ba5cf51025ba51e0c36cf1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
#
# Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for
# distribution information.


DIR="$1"
REALDIR="$2"

SOFTLINK=""

echo "mksoftlinks $DIR $REALDIR"

for component in `echo $REALDIR | tr '-' ' '`
do
	if test "$SOFTLINK" = ""
	then
		SOFTLINK="$component"
	else
		SOFTLINK="$SOFTLINK""-$component"
	fi

	if test "$SOFTLINK" != "$REALDIR"
	then
		test -d $DIR/$SOFTLINK/. && continue
		echo rm -f $DIR/$SOFTLINK
		rm -f $DIR/$SOFTLINK
		echo ln -s $REALDIR $DIR/$SOFTLINK
		ln -s $REALDIR $DIR/$SOFTLINK
	fi
done