summaryrefslogtreecommitdiff
path: root/source3/script/installdirs.sh
blob: db38a11b672eccc0bdfac1648003ca4f04658c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

INSTALLPERMS=$1
DESTDIR=`echo $2 | sed 's/\/\//\//g'`
shift
shift

for dir in $@; do
	DIRNAME=`echo $dir | sed 's/\/\//\//g'`
	if [ ! -d $DESTDIR/$DIRNAME ]; then
		mkdir -m $INSTALLPERMS -p $DESTDIR/$DIRNAME
	fi

	if [ ! -d $DESTDIR/$DIRNAME ]; then
		echo "Failed to make directory $DESTDIR/$DIRNAME "
		exit 1
	fi

	shift;
done