#! /bin/sh
/etc/killall smbd nmbd
chkconfig samba off
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 '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
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 'echo 'netbios-ns 137/udp echo 'netbios-ssn 139/tcp
/etc/killall -HUP inetd