patch from TAKEDA yasuma to bypass any missing language files
[Samba/gebeck_regimport.git] / source3 / script / installswat.sh
blob027ca3511058d0eb62fb4d0ab56d9a548d60ef5e
1 #!/bin/sh
2 #first version March 1998, Andrew Tridgell
4 SWATDIR=`echo $1 | sed 's/\/\//\//g'`
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 if [ ! -f $f ] ; then
33 continue
35 FNAME=$SWATDIR/$ln/images/`basename $f`
36 echo $FNAME
37 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
38 chmod 0644 $FNAME
39 done
41 # Install html help
43 for f in $SRCDIR../swat/$ln/help/*.html; do
44 if [ ! -f $f ] ; then
45 continue
47 FNAME=$SWATDIR/$ln/help/`basename $f`
48 echo $FNAME
49 if [ "x$BOOKDIR" = "x" ]; then
50 cat $f | sed 's/@BOOKDIR@.*$//' > $f.tmp
51 else
52 cat $f | sed 's/@BOOKDIR@//' > $f.tmp
54 f=$f.tmp
55 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
56 rm -f $f
57 chmod 0644 $FNAME
58 done
60 # Install "server-side" includes
62 for f in $SRCDIR../swat/$ln/include/*.html; do
63 if [ ! -f $f ] ; then
64 continue
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 html documentation
76 if [ -d $SRCDIR../docs/htmldocs/ ]; then
78 for f in $SRCDIR../docs/htmldocs/*.html; do
79 FNAME=$SWATDIR/help/`basename $f`
80 echo $FNAME
81 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
82 chmod 0644 $FNAME
83 done
86 # Install Using Samba book (but only if it is there)
88 if [ "x$BOOKDIR" != "x" -a -f $SRCDIR../docs/htmldocs/using_samba/toc.html ]; then
90 # Create directories
92 for d in $BOOKDIR $BOOKDIR/figs ; do
93 if [ ! -d $d ]; then
94 mkdir $d
95 if [ ! -d $d ]; then
96 echo Failed to make directory $d, does $USER have privileges?
97 exit 1
100 done
102 # HTML files
104 for f in $SRCDIR../docs/htmldocs/using_samba/*.html; do
105 FNAME=$BOOKDIR/`basename $f`
106 echo $FNAME
107 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
108 chmod 0644 $FNAME
109 done
111 for f in $SRCDIR../docs/htmldocs/using_samba/*.gif; do
112 FNAME=$BOOKDIR/`basename $f`
113 echo $FNAME
114 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
115 chmod 0644 $FNAME
116 done
118 # Figures
120 for f in $SRCDIR../docs/htmldocs/using_samba/figs/*.gif; do
121 FNAME=$BOOKDIR/figs/`basename $f`
122 echo $FNAME
123 cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
124 chmod 0644 $FNAME
125 done
129 cat << EOF
130 ======================================================================
131 The SWAT files have been installed. Remember to read the swat/README
132 for information on enabling and using SWAT
133 ======================================================================
136 exit 0