1998-03-12 06:12:30 +03:00
#!/bin/sh
#fist version March 1998, Andrew Tridgell
SWATDIR = $1
1998-07-29 07:08:05 +04:00
SRCDIR = $2 /
2001-05-07 07:55:54 +04:00
BOOKDIR = $SWATDIR /using_samba
1998-07-29 07:08:05 +04:00
echo Installing SWAT in $SWATDIR
1999-12-13 16:27:58 +03:00
echo Installing the Samba Web Administration Tool
1998-03-12 06:12:30 +03:00
2001-10-15 09:15:31 +04:00
LANGS = " . `cd $SRCDIR ../swat/; /bin/echo lang/??` "
echo Installing langs are ` cd $SRCDIR ../swat/lang/; /bin/echo ??`
2001-09-25 21:40:12 +04:00
for ln in $LANGS ; do
2001-10-15 09:15:31 +04:00
SWATLANGDIR = $SWATDIR /$ln
for d in $SWATLANGDIR $SWATLANGDIR /help $SWATLANGDIR /images \
2001-09-25 21:40:12 +04:00
$SWATLANGDIR /include; do
2001-01-13 00:47:01 +03:00
if [ ! -d $d ] ; then
2001-09-25 21:40:12 +04:00
mkdir -p $d
2001-01-13 00:47:01 +03:00
if [ ! -d $d ] ; then
echo Failed to make directory $d , does $USER have privileges?
exit 1
fi
fi
2001-10-15 09:15:31 +04:00
done
2001-09-25 21:40:12 +04:00
done
2001-01-13 00:47:01 +03:00
# Install images
2001-09-25 21:40:12 +04:00
for ln in $LANGS ; do
2001-01-13 00:47:01 +03:00
2001-09-25 21:40:12 +04:00
for f in $SRCDIR ../swat/$ln /images/*.gif; do
FNAME = $SWATDIR /$ln /images/` basename $f `
1998-03-12 06:12:30 +03:00
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
2001-01-13 00:47:01 +03:00
# Install html help
2001-09-25 21:40:12 +04:00
for f in $SRCDIR ../swat/$ln /help/*.html; do
FNAME = $SWATDIR /$ln /help/` basename $f `
1998-03-12 06:12:30 +03:00
echo $FNAME
2001-01-13 00:47:01 +03:00
if [ " x $BOOKDIR " = "x" ] ; then
cat $f | sed 's/@BOOKDIR@.*$//' > $f .tmp
else
cat $f | sed 's/@BOOKDIR@//' > $f .tmp
fi
f = $f .tmp
1998-03-12 06:12:30 +03:00
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
2001-01-13 00:47:01 +03:00
rm -f $f
1998-03-12 06:12:30 +03:00
chmod 0644 $FNAME
done
2001-01-13 00:47:01 +03:00
# Install html documentation
1998-11-27 09:09:03 +03:00
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
2001-01-13 00:47:01 +03:00
# Install "server-side" includes
2001-09-25 21:40:12 +04:00
for f in $SRCDIR ../swat/$ln /include/*.html; do
FNAME = $SWATDIR /$ln /include/` basename $f `
1998-09-01 10:03:52 +04:00
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
2001-09-25 21:40:12 +04:00
done
2001-01-13 00:47:01 +03:00
# Install Using Samba book
if [ " x $BOOKDIR " != "x" ] ; then
# Create directories
for d in $BOOKDIR $BOOKDIR /figs $BOOKDIR /gifs; do
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
# 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
# Gifs
for f in $SRCDIR ../docs/htmldocs/using_samba/gifs/*.gif; do
FNAME = $BOOKDIR /gifs/` basename $f `
echo $FNAME
cp $f $FNAME || echo Cannot install $FNAME . Does $USER have privileges?
chmod 0644 $FNAME
done
fi
1998-03-12 06:12:30 +03:00
cat << EOF
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
1998-03-14 04:26:46 +03:00
The SWAT files have been installed. Remember to read the swat/README
1998-03-12 06:12:30 +03:00
for information on enabling and using SWAT
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EOF
exit 0