reran autoconf
[Samba.git] / source / script / installswat.sh
blob8868d4cbb1f80894567f97983afe204a420696e4
1 #!/bin/sh
2 #fist version March 1998, Andrew Tridgell
4 SWATDIR=$1
5 SRCDIR=$2/
6 BOOKDIR=$SWATDIR/using_samba
8 echo Installing SWAT in $SWATDIR
9 echo Installing the Samba Web Administration Tool
11 for d in $SWATDIR $SWATDIR/help $SWATDIR/images $SWATDIR/include; do
12 if [ ! -d $d ]; then
13 mkdir $d
14 if [ ! -d $d ]; then
15 echo Failed to make directory $d, does $USER have privileges?
16 exit 1
19 done
21 # Install images
23 for f in $SRCDIR../swat/images/*.gif; do
24 FNAME=$SWATDIR/images/`basename $f`
25 echo $FNAME
26 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
27 chmod 0644 $FNAME
28 done
30 # Install html help
32 for f in $SRCDIR../swat/help/*.html; do
33 FNAME=$SWATDIR/help/`basename $f`
34 echo $FNAME
35 if [ "x$BOOKDIR" = "x" ]; then
36 cat $f | sed 's/@BOOKDIR@.*$//' > $f.tmp
37 else
38 cat $f | sed 's/@BOOKDIR@//' > $f.tmp
40 f=$f.tmp
41 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
42 rm -f $f
43 chmod 0644 $FNAME
44 done
46 # Install html documentation
48 for f in $SRCDIR../docs/htmldocs/*.html; do
49 FNAME=$SWATDIR/help/`basename $f`
50 echo $FNAME
51 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
52 chmod 0644 $FNAME
53 done
55 # Install "server-side" includes
57 for f in $SRCDIR../swat/include/*.html; do
58 FNAME=$SWATDIR/include/`basename $f`
59 echo $FNAME
60 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
61 chmod 0644 $FNAME
62 done
64 # Install Using Samba book
66 if [ "x$BOOKDIR" != "x" ]; then
68 # Create directories
70 for d in $BOOKDIR $BOOKDIR/figs $BOOKDIR/gifs; do
71 if [ ! -d $d ]; then
72 mkdir $d
73 if [ ! -d $d ]; then
74 echo Failed to make directory $d, does $USER have privileges?
75 exit 1
78 done
80 # HTML files
82 for f in $SRCDIR../docs/htmldocs/using_samba/*.html; do
83 FNAME=$BOOKDIR/`basename $f`
84 echo $FNAME
85 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
86 chmod 0644 $FNAME
87 done
89 # Figures
91 for f in $SRCDIR../docs/htmldocs/using_samba/figs/*.gif; do
92 FNAME=$BOOKDIR/figs/`basename $f`
93 echo $FNAME
94 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
95 chmod 0644 $FNAME
96 done
98 # Gifs
100 for f in $SRCDIR../docs/htmldocs/using_samba/gifs/*.gif; do
101 FNAME=$BOOKDIR/gifs/`basename $f`
102 echo $FNAME
103 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
104 chmod 0644 $FNAME
105 done
109 cat << EOF
110 ======================================================================
111 The SWAT files have been installed. Remember to read the swat/README
112 for information on enabling and using SWAT
113 ======================================================================
116 exit 0