summaryrefslogtreecommitdiff
path: root/packaging/SGI/inetd.sh
blob: 1d403978aecba3e034d791b53b9a1f3d57ffef72 (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
#! /bin/sh
#
# kill any running samba processes
#
/etc/killall smbd nmbd
chkconfig samba off

#
# add SAMBA deamons to inetd.conf
#
cp /etc/inetd.conf /etc/inetd.conf.O

if [ $? -ne 0 ]; then exit 1; fi
if [ ! -r /etc/inetd.conf.O -o ! -w /etc/inetd.conf ]; then exit 1; fi

sed -e "/^netbios/D" -e "/^#SAMBA/D" /etc/inetd.conf.O > /etc/inetd.conf
echo '#SAMBA services' >> /etc/inetd.conf
echo netbios-ssn stream tcp  nowait  root    /usr/samba/bin/smbd smbd  >> /etc/inetd.conf
echo netbios-ns  dgram udp   wait    root    /usr/samba/bin/nmbd nmbd -S >> /etc/inetd.conf

#
# add SAMBA service ports to /etc/services
#
cp /etc/services /etc/services.O

if [ $? -ne 0 ]; then exit 1; fi
if [ ! -r /etc/services.O -o ! -w /etc/services ]; then exit 1; fi

sed -e "/^netbios/D" -e "/^#SAMBA/D" /etc/services.O > /etc/services
echo '#SAMBA services' >> /etc/services
echo 'netbios-ns	137/udp				# SAMBA' >> /etc/services
echo 'netbios-ssn	139/tcp				# SAMBA' >> /etc/services

#
# restart inetd to start SAMBA
#
/etc/killall -HUP inetd