home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- if [ ! -d $2/usr/samba/var ]; then
- mkdir $2/usr/samba/var > /dev/null;
- if [ $? -eq 0 ]; then
- echo "** Failed to make $2/usr/samba/var";
- exit -1;
- fi;
- fi;
-
- if [ ! -f $2/usr/samba/lib/smb.conf ]; then
- echo "Copying example smb.conf to /usr/samba/lib...";
- cp $2/usr/samba/lib/smb.conf.example $2/usr/samba/lib/smb.conf > /dev/null;
- else
- echo "/usr/samba/lib/smb.conf exists, no changes made.";
- fi;
-
- grep -i samba /etc/inetd.conf > /dev/null;
- if [ $? -ne 0 ]; then
- echo "Adding Samba services to inetd.conf.";
- echo "" >> /etc/inetd.conf;
- echo "#" >> /etc/inetd.conf
- echo "# Samba services" >> /etc/inetd.conf
- echo "#" >> /etc/inetd.conf
- echo "netbios-ssn stream tcp nowait root $2/usr/samba/bin/smbd smbd -d 0" >> /etc/inetd.conf
- echo "netbios-ns dgram udp wait root $2/usr/samba/bin/nmbd nmbd -d 0 " >> /etc/inetd.conf
- echo "Restarting inetd.";
- kill -HUP `ps cax | egrep "inetd" | awk '{print $1;}'`
- fi;
-
- nidump services . | grep netbios > /dev/null
- if [ $? -ne 0 ]; then
- echo "Adding Samba services to local NetInfo domain.";
- niutil -create . /services/netbios-ssn > /dev/null;
- niutil -createprop . /services/netbios-ssn name netbios-ssn > /dev/null;
- niutil -createprop . /services/netbios-ssn protocol tcp > /dev/null;
- niutil -createprop . /services/netbios-ssn port 139 > /dev/null;
- niutil -create . /services/netbios-ns > /dev/null;
- niutil -createprop . /services/netbios-ns name netbios-ns > /dev/null;
- niutil -createprop . /services/netbios-ns protocol udp > /dev/null;
- niutil -createprop . /services/netbios-ns port 137 > /dev/null;
- fi;
-
- echo "Finished installing Samba.";
-
- exit 0;