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-01-13 00:47:01 +03:00
BOOKDIR = $3
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
1998-09-01 10:03:52 +04:00
for d in $SWATDIR $SWATDIR /help $SWATDIR /images $SWATDIR /include; do
2001-01-13 00:47:01 +03:00
if [ ! -d $d ] ; then
mkdir $d
if [ ! -d $d ] ; then
echo Failed to make directory $d , does $USER have privileges?
exit 1
fi
fi
1998-03-12 06:12:30 +03:00
done
2001-01-13 00:47:01 +03:00
# Install images
1998-03-12 06:12:30 +03:00
for f in $SRCDIR ../swat/images/*.gif; do
FNAME = $SWATDIR /images/` 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 html help
1998-03-12 06:12:30 +03:00
for f in $SRCDIR ../swat/help/*.html; do
FNAME = $SWATDIR /help/` basename $f `
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
1998-09-01 10:03:52 +04:00
for f in $SRCDIR ../swat/include/*.html; do
FNAME = $SWATDIR /include/` 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 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