This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[samba.git] / packaging / Caldera / UnixWare / pkg / postinstall
1 #!/bin/sh
2 #
3 # Create /var/spool/samba, setup swat to be run out of inetd on port 901,
4 # initialize the lmhosts file and create the codepage load files
5 #
6 # Written 10-Aug-1999 by Ronald Joe Record (rr@sco.com)
7 #
8
9 SPOOL=/var/spool/samba
10 SVCS=/etc/services
11 INET=/etc/inetd.conf
12 PREFIX=/usr/local/samba
13 LMHOST=/etc/lmhosts
14
15 [ -d $SPOOL ] || {
16      mkdir -p $SPOOL
17      chmod 1777 $SPOOL
18 }
19
20 grep swat $SVCS > /dev/null || {
21      echo "swat    901/tcp    # Samba Web Administration Tool " >> $SVCS
22 }
23
24 grep swat $INET > /dev/null || {
25      echo "swat stream tcp nowait root /usr/local/samba/bin/swat swat " >> $INET
26 }
27
28 if [ -f $LMHOST ]
29 then
30     grep localhost $LMHOST > /dev/null || {
31         echo 127.0.0.1 localhost >> $LMHOST
32     }
33 else
34     echo 127.0.0.1 localhost > $LMHOST
35 fi
36
37 #
38 # Build codepage load files
39 #
40
41 cd ${PREFIX}/lib/codepages
42 for i in 437 737 775 850 852 861 866 932 936 949 950 1251
43 do
44    ${PREFIX}/bin/make_smbcodepage c $i \
45    ${PREFIX}/lib/codepages/src/codepage_def.$i \
46    ${PREFIX}/lib/codepages/codepage.$i
47 done
48 for i in 437 737 850 852 861 866 932 936 949 950 \
49          ISO8859-1 ISO8859-2 ISO8859-5 ISO8859-7 KOI8-R
50 do
51    ${PREFIX}/bin/make_unicodemap $i \
52    ${PREFIX}/lib/codepages/src/CP$i.TXT \
53    ${PREFIX}/lib/codepages/unicode_map.$i
54 done
55
56 kill -1 `ps -e | grep inetd | awk ' { print $1 } '`