sync with the sec_desc parsing fix from APP_HEAD. I will probably need
[Samba.git] / source / script / installswat.sh
blobc66604cdb84e40d8e0d8b1d612caa94ebf50f961
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 LANGS=". `cd $SRCDIR../swat/; /bin/echo lang/??`"
12 echo Installing langs are `cd $SRCDIR../swat/lang/; /bin/echo ??`
14 for ln in $LANGS; do
15 SWATLANGDIR=$SWATDIR/$ln
16 for d in $SWATLANGDIR $SWATLANGDIR/help $SWATLANGDIR/images \
17 $SWATLANGDIR/include; do
18 if [ ! -d $d ]; then
19 mkdir -p $d
20 if [ ! -d $d ]; then
21 echo Failed to make directory $d, does $USER have privileges?
22 exit 1
25 done
26 done
28 # Install images
29 for ln in $LANGS; do
31 for f in $SRCDIR../swat/$ln/images/*.gif; do
32 FNAME=$SWATDIR/$ln/images/`basename $f`
33 echo $FNAME
34 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
35 chmod 0644 $FNAME
36 done
38 # Install html help
40 for f in $SRCDIR../swat/$ln/help/*.html; do
41 FNAME=$SWATDIR/$ln/help/`basename $f`
42 echo $FNAME
43 if [ "x$BOOKDIR" = "x" ]; then
44 cat $f | sed 's/@BOOKDIR@.*$//' > $f.tmp
45 else
46 cat $f | sed 's/@BOOKDIR@//' > $f.tmp
48 f=$f.tmp
49 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
50 rm -f $f
51 chmod 0644 $FNAME
52 done
54 # Install html documentation
56 for f in $SRCDIR../docs/htmldocs/*.html; do
57 FNAME=$SWATDIR/help/`basename $f`
58 echo $FNAME
59 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
60 chmod 0644 $FNAME
61 done
63 # Install "server-side" includes
65 for f in $SRCDIR../swat/$ln/include/*.html; do
66 FNAME=$SWATDIR/$ln/include/`basename $f`
67 echo $FNAME
68 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
69 chmod 0644 $FNAME
70 done
72 done
74 # Install Using Samba book
76 if [ "x$BOOKDIR" != "x" ]; then
78 # Create directories
80 for d in $BOOKDIR $BOOKDIR/figs $BOOKDIR/gifs; do
81 if [ ! -d $d ]; then
82 mkdir $d
83 if [ ! -d $d ]; then
84 echo Failed to make directory $d, does $USER have privileges?
85 exit 1
88 done
90 # HTML files
92 for f in $SRCDIR../docs/htmldocs/using_samba/*.html; do
93 FNAME=$BOOKDIR/`basename $f`
94 echo $FNAME
95 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
96 chmod 0644 $FNAME
97 done
99 # Figures
101 for f in $SRCDIR../docs/htmldocs/using_samba/figs/*.gif; do
102 FNAME=$BOOKDIR/figs/`basename $f`
103 echo $FNAME
104 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
105 chmod 0644 $FNAME
106 done
108 # Gifs
110 for f in $SRCDIR../docs/htmldocs/using_samba/gifs/*.gif; do
111 FNAME=$BOOKDIR/gifs/`basename $f`
112 echo $FNAME
113 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
114 chmod 0644 $FNAME
115 done
119 cat << EOF
120 ======================================================================
121 The SWAT files have been installed. Remember to read the swat/README
122 for information on enabling and using SWAT
123 ======================================================================
126 exit 0