summaryrefslogtreecommitdiff
path: root/source3/script/installswat.sh
blob: 6bd11bcb99d6e849dd78ac7e7957c4a3b8f958c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#fist version March 1998, Andrew Tridgell

SWATDIR=$1
SRCDIR=$2/

echo Installing SWAT in $SWATDIR

echo Installing the Samba Web Admisistration Tool

for d in $SWATDIR $SWATDIR/help $SWATDIR/images $SWATDIR/include; 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

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

for f in $SRCDIR../swat/images/*.jpg; do
      FNAME=$SWATDIR/images/`basename $f`
      echo $FNAME
      cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
      chmod 0644 $FNAME
done

for f in $SRCDIR../swat/help/*.html; do
      FNAME=$SWATDIR/help/`basename $f`
      echo $FNAME
      cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
      chmod 0644 $FNAME
done

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

cat << EOF
======================================================================
The SWAT files have been installed. Remember to read the swat/README
for information on enabling and using SWAT
======================================================================
EOF

exit 0