summaryrefslogtreecommitdiffstats
path: root/source3/script/installdirs.sh
blob: 062b34b8c696ddd10573deaf45e0eba5f26c6503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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
done