0001-01-01 02:30:17 +02:30
#!/bin/sh
0001-01-01 02:30:17 +02:30
#first version March 1998, Andrew Tridgell
0001-01-01 02:30:17 +02:30
0001-01-01 02:30:17 +02:30
SWATDIR = ` echo $1 | sed 's/\/\//\//g' `
0001-01-01 02:30:17 +02:30
SRCDIR = $2 /
0001-01-01 02:30:17 +02:30
BOOKDIR = $SWATDIR /using_samba
0001-01-01 02:30:17 +02:30
echo Installing SWAT in $SWATDIR
0001-01-01 02:30:17 +02:30
echo Installing the Samba Web Administration Tool
0001-01-01 02:30:17 +02:30
0001-01-01 02:30:17 +02:30
LANGS = " . `cd $SRCDIR ../swat/; /bin/echo lang/??` "
echo Installing langs are ` cd $SRCDIR ../swat/lang/; /bin/echo ??`
0001-01-01 02:30:17 +02:30
for ln in $LANGS ; do
0001-01-01 02:30:17 +02:30
SWATLANGDIR = $SWATDIR /$ln
for d in $SWATLANGDIR $SWATLANGDIR /help $SWATLANGDIR /images \
0001-01-01 02:30:17 +02:30
$SWATLANGDIR /include; do
0001-01-01 02:30:17 +02:30
if [ ! -d $d ] ; then
0001-01-01 02:30:17 +02:30
mkdir -p $d
0001-01-01 02:30:17 +02:30
if [ ! -d $d ] ; then
echo Failed to make directory $d , does $USER have privileges?
exit 1
fi
fi
0001-01-01 02:30:17 +02:30
done
0001-01-01 02:30:17 +02:30
done
0001-01-01 02:30:17 +02:30
# Install images
0001-01-01 02:30:17 +02:30
for ln in $LANGS ; do
0001-01-01 02:30:17 +02:30
0001-01-01 02:30:17 +02:30
for f in $SRCDIR ../swat/$ln /images/*.gif; do
FNAME = $SWATDIR /$ln /images/` basename $f `
0001-01-01 02:30:17 +02:30
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
0001-01-01 02:30:17 +02:30
# Install html help
0001-01-01 02:30:17 +02:30
for f in $SRCDIR ../swat/$ln /help/*.html; do
FNAME = $SWATDIR /$ln /help/` basename $f `
0001-01-01 02:30:17 +02:30
echo $FNAME
0001-01-01 02:30:17 +02:30
if [ " x $BOOKDIR " = "x" ] ; then
cat $f | sed 's/@BOOKDIR@.*$//' > $f .tmp
else
cat $f | sed 's/@BOOKDIR@//' > $f .tmp
fi
f = $f .tmp
0001-01-01 02:30:17 +02:30
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
0001-01-01 02:30:17 +02:30
rm -f $f
0001-01-01 02:30:17 +02:30
chmod 0644 $FNAME
done
0001-01-01 02:30:17 +02:30
# Install html documentation
0001-01-01 02:30:17 +02:30
for f in $SRCDIR ../docs/htmldocs/*.html; do
FNAME = $SWATDIR /help/` basename $f `
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
0001-01-01 02:30:17 +02:30
# Install "server-side" includes
0001-01-01 02:30:17 +02:30
for f in $SRCDIR ../swat/$ln /include/*.html; do
FNAME = $SWATDIR /$ln /include/` basename $f `
0001-01-01 02:30:17 +02:30
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
0001-01-01 02:30:17 +02:30
done
0001-01-01 02:30:17 +02:30
# Install Using Samba book (but only if it is there)
0001-01-01 02:30:17 +02:30
0001-01-01 02:30:17 +02:30
if [ " x $BOOKDIR " != "x" -a -f $SRCDIR ../docs/htmldocs/using_samba/toc.html ] ; then
0001-01-01 02:30:17 +02:30
# Create directories
0001-01-01 02:30:17 +02:30
for d in $BOOKDIR $BOOKDIR /figs ; do
0001-01-01 02:30:17 +02:30
if [ ! -d $d ] ; then
mkdir $d
if [ ! -d $d ] ; then
echo Failed to make directory $d , does $USER have privileges?
exit 1
fi
fi
done
# HTML files
for f in $SRCDIR ../docs/htmldocs/using_samba/*.html; do
FNAME = $BOOKDIR /` basename $f `
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
0001-01-01 02:30:17 +02:30
for f in $SRCDIR ../docs/htmldocs/using_samba/*.gif; do
FNAME = $BOOKDIR /` basename $f `
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
0001-01-01 02:30:17 +02:30
# Figures
for f in $SRCDIR ../docs/htmldocs/using_samba/figs/*.gif; do
FNAME = $BOOKDIR /figs/` basename $f `
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
fi
0001-01-01 02:30:17 +02:30
cat << EOF
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
0001-01-01 02:30:17 +02:30
The SWAT files have been installed. Remember to read the swat/README
0001-01-01 02:30:17 +02:30
for information on enabling and using SWAT
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EOF
exit 0