added an install target for SWAT
[ira/wip.git] / source3 / script / installswat.sh
1 #!/bin/sh
2 #fist version March 1998, Andrew Tridgell
3
4 SWATDIR=$1
5 SRCDIR=$2
6
7 echo Installing the Samba Web Admisistration Tool
8
9 for d in $SWATDIR $SWATDIR/help $SWATDIR/images; do
10 if [ ! -d $d ]; then
11   mkdir $d
12 if [ ! -d $d ]; then
13   echo Failed to make directory $d, does $USER have privileges?
14   exit 1
15 fi
16 fi
17 done
18
19 for f in $SRCDIR../swat/images/*.gif; do
20       FNAME=$SWATDIR/images/`basename $f`
21       echo $FNAME
22       cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
23       chmod 0644 $FNAME
24 done
25
26 for f in $SRCDIR../swat/help/*.html; do
27       FNAME=$SWATDIR/help/`basename $f`
28       echo $FNAME
29       cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
30       chmod 0644 $FNAME
31 done
32
33 cat << EOF
34 ======================================================================
35 The SWAT files have been installed. Remember to read the web/README
36 for information on enabling and using SWAT
37 ======================================================================
38 EOF
39
40 exit 0
41