r19142: ensure no race conditions during installation by having same name in source...
[samba.git] / source / script / installswat.sh
1 #!/bin/sh
2
3 SWATDIR=$1
4 SRCDIR=$2
5
6 echo Installing swat files in $SWATDIR
7
8 cd $SRCDIR/../swat || exit 1
9
10 mkdir -p $SWATDIR || exit 1
11
12 installdir() {
13     for f in $*; do
14         dname=`dirname $f`
15         echo "Installing $f in $dname"
16         test -d $SWATDIR/$dname || mkdir -p $SWATDIR/$dname || exit 1
17         cp $f $SWATDIR/$dname/ || exit 1
18         chmod 0644 $SWATDIR/$f || exit 1
19     done
20 }
21
22 installdir `find . -name '*.html'`
23 installdir `find . -name '*.js'`
24 installdir `find . -name '*.esp'`
25 installdir `find . -name '*.css'`
26 installdir `find . -name '*.png'`
27 installdir `find . -name '*.ico'`
28 installdir `find . -name '*.gif'`
29 installdir `find . -name '*.ejs'`
30
31 cat << EOF
32 ======================================================================
33 The swat files have been installed. 
34 ======================================================================
35 EOF
36
37 cd $SRCDIR/.. || exit 1
38
39 installdir `find services -name '*.esp'`
40
41 cat << EOF
42 ======================================================================
43 The JSON-RPC services have been installed. 
44 ======================================================================
45 EOF
46
47
48 exit 0
49