NMT:Samba: Difference between revisions

From Lundman Wiki
No edit summary
No edit summary
 
Line 17: Line 17:
To fix this, telnet into the box and copy to the /mnt/syb8634/etc/smb.sh file to a download directory and edit the following section as below
To fix this, telnet into the box and copy to the /mnt/syb8634/etc/smb.sh file to a download directory and edit the following section as below


start() {
start() {
         if [ -e /mnt/syb8634/bin/nmt_services.cgi ]; then
         if [ -e /mnt/syb8634/bin/nmt_services.cgi ]; then
                 echo Updating samba workgroup...
                 echo Updating samba workgroup...
Line 23: Line 23:
                 /mnt/syb8634/bin/nmt_services.cgi cmd=smb_workgrp opt=${smbworkg
                 /mnt/syb8634/bin/nmt_services.cgi cmd=smb_workgrp opt=${smbworkg
         fi
         fi
         passwd
         passwd
         echo 'path = /opt/sybhttpd/localhost.drives' >> /etc/samba/lib/smb.conf
         echo 'path = /opt/sybhttpd/localhost.drives' >> /etc/samba/lib/smb.conf
         if [ -e /mnt/syb8634/bin/nmbd ]; then
         if [ -e /mnt/syb8634/bin/nmbd ]; then
                 if [ -e /mnt/syb8634/bin/smbd ]; then
                 if [ -e /mnt/syb8634/bin/smbd ]; then
Line 35: Line 32:
                 fi
                 fi
         fi
         fi
}
}

Latest revision as of 16:26, 27 November 2010

Easy. Once Telnet access is enabled

Edit /etc/samba/lib/smb.conf and edit the Share section and simply remove the HARD_DRIVE from the path

         [Share]
         path = /opt/sybhttpd/localhost.drives

Start and Stop Samba to see the effect, however you may need a reboot.

You can now mount your USB devices as a network drive in Windows, or share it with your other media streaming devices around the house.

If your drive is formatted with a linux extended file system, you may need to adjust your permissions accordingly to allow write access.

Newer versions

A recent upgrade reveals that this method no longer works, as the smb.conf configuration file is now created dynamically on startup.

To fix this, telnet into the box and copy to the /mnt/syb8634/etc/smb.sh file to a download directory and edit the following section as below

start() {
       if [ -e /mnt/syb8634/bin/nmt_services.cgi ]; then
               echo Updating samba workgroup...
               smbworkgrp=`pflash get workgroup`
               /mnt/syb8634/bin/nmt_services.cgi cmd=smb_workgrp opt=${smbworkg
       fi
       passwd
       echo 'path = /opt/sybhttpd/localhost.drives' >> /etc/samba/lib/smb.conf
       if [ -e /mnt/syb8634/bin/nmbd ]; then
               if [ -e /mnt/syb8634/bin/smbd ]; then
                       echo -n "Starting samba"
               /mnt/syb8634/bin/nmbd -D
                       /mnt/syb8634/bin/smbd -D
               fi
       fi
}