home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / samba / install_samba next >
Text File  |  1996-09-10  |  2KB  |  46 lines

  1. #!/bin/sh
  2.  
  3. if [ ! -d $2/usr/samba/var ]; then 
  4.     mkdir $2/usr/samba/var  > /dev/null; 
  5.     if [ $? -eq 0 ]; then 
  6.         echo "** Failed to make $2/usr/samba/var";
  7.         exit -1;
  8.     fi;
  9. fi;
  10.  
  11. if [ ! -f $2/usr/samba/lib/smb.conf ]; then
  12.     echo "Copying example smb.conf to /usr/samba/lib...";
  13.     cp $2/usr/samba/lib/smb.conf.example $2/usr/samba/lib/smb.conf  > /dev/null;
  14. else
  15.     echo "/usr/samba/lib/smb.conf exists, no changes made.";
  16. fi;
  17.  
  18. grep -i samba /etc/inetd.conf > /dev/null;
  19. if [ $? -ne 0 ]; then
  20.     echo "Adding Samba services to inetd.conf.";
  21.     echo "" >> /etc/inetd.conf;
  22.     echo "#" >> /etc/inetd.conf
  23.     echo "# Samba services" >> /etc/inetd.conf
  24.     echo "#" >> /etc/inetd.conf
  25.     echo "netbios-ssn     stream  tcp     nowait  root    $2/usr/samba/bin/smbd smbd -d 0" >> /etc/inetd.conf
  26.     echo "netbios-ns              dgram   udp     wait    root    $2/usr/samba/bin/nmbd nmbd -d 0 " >> /etc/inetd.conf
  27.     echo "Restarting inetd.";
  28.     kill -HUP `ps cax | egrep "inetd" | awk '{print $1;}'`
  29. fi;
  30.  
  31. nidump services . | grep netbios > /dev/null
  32. if [ $? -ne 0 ]; then
  33.     echo "Adding Samba services to local NetInfo domain.";
  34.     niutil -create . /services/netbios-ssn > /dev/null;
  35.     niutil -createprop . /services/netbios-ssn name netbios-ssn > /dev/null;
  36.     niutil -createprop . /services/netbios-ssn protocol tcp > /dev/null;
  37.     niutil -createprop . /services/netbios-ssn port 139 > /dev/null;
  38.     niutil -create . /services/netbios-ns > /dev/null;
  39.     niutil -createprop . /services/netbios-ns name netbios-ns > /dev/null;
  40.     niutil -createprop . /services/netbios-ns protocol udp > /dev/null;
  41.     niutil -createprop . /services/netbios-ns port 137 > /dev/null;
  42. fi;
  43.  
  44. echo "Finished installing Samba.";
  45.  
  46. exit 0;