> Which leads into my next question... :')
> 
> How does a linux client handle shares? I see an smbclient app, included with
> the samba distribution... but surely there's more. I've found a browser of
> sorts... XSMBROWSER... works ok, but my god... I'll never sell a linux samba
> client to a prospective customer with it.
> 
> So.. what does everyone else use? Has anyone found a real smb browser for
> linux? Any tips or input will be appreciate.

This seems so easy I may be missing the real question. What I do on a linux
box to mount shares is run a script, which I include here:

for i in `/usr/local/bin/smbwho | tr -s " "  | egrep ^[0-9] | cut -d " " -f2`
 do
        echo "Checking out /mnt/NetWork/$i"
      [  -d "/mnt/NetWork/$i" ] || {
                        mkdir /mnt/NetWork/$i
                        chown jlh.users /mnt/NetWork/$i
                        chmod 755 /mnt/NetWork/$i
                        echo Have created /mnt/Network/$i
                                }
      [ $i = "HAMMER2" ] && chmod 700 /mnt/NetWork/$i
done

for i in `/usr/local/bin/smbwho | tr -s " "  | egrep ^[0-9] | cut -d " " -f2`
do

 for j in `smbclient -L $i -N | grep Disk  \
        | sed 's/Disk.*//' |  tr -d '\011' |  sed 's/ *$//' \
        | sed 's/.*/"&"/'`
  do
    l=""
    k="$m $j"
    l=`echo $k | sed  's/\(.*\)\([^"]\)$//'`
    if  [ -z "$l" ];
        then
         m=$k
     else m=""
     n=`echo $k | sed 's/^ *//' | sed 's/"//g' `
     echo Checking out /mnt/Network/$i/$n
     [ -d "/mnt/NetWork/$i/$n" ] ||   mkdir "/mnt/NetWork/$i/$n"

      t=`mount  | sed -n "/\/mnt\/NetWork\/$i\/$n/p"`
      echo $t                                         
 [ -z "$t" ] &&  {
     [ "$n" != printer$ ] && smbmount //$i/"$n" /mnt/NetWork/$i/"$n" -o 
uid=jlh,gid=users,guest,rw,fmask=777
     chown jlh.users "/mnt/NetWork/$i/$n"
     chmod 755 "/mnt/NetWork/$i/$n"
                      }
   fi
   done
done                  
AND===================
The script smbwho is as follows, called in the first line of this script, is:

killall -15 nmbd
/usr/sbin/findsmb
echo have returned from findsmb
nmbd -D                  
===============================
You can pick at this and use whatever seems reasonable. Basically, it first
turns off nmbd, runs smbwho, another  script I wrote (see below) that uses a script
called findsmb, included with caldera 2.4, and finds out
what machines on the network are offering shares. It makes
mount points for each machine if they don't exist already. Then, using
smbclient, if finds out which disk shares are being offered. Then, it mounts them as a 
guest.
I never have figured out permissions, but when mounted this way, the client
can read but not write to the mounted shares. I am sure you can change that
if you want.
The security on the host machines is set to share and guests are allowed. 
Once they are mounted, you can use any file browser to see the files.
The biggest headache, aside from permissions,  has been the smbmount command, which 
seems to
change its syntax with every release. If the smbmount command fails, make
sure smbmount is installed on your computer. 
I have found it important to umount smb shares when rebooting, since the
smb shares seem to hang up some of the network shutdown scripts. So, I put
this script somewhere so it gets run when the network goes down:

mount | grep " type smbfs " | sed 's/^.*on *//' | sed 's/ *type.*//' \
      | sed 's/ /\\\ /g' | xargs -n1 -i{}  umount {}
                                                                             
(It is obvious that I wrote this script before I learned how to
use the for command in bash!)

Now, the problem I have had is in getting proper updates on the mounted
shares, but I haven't worried about that for a while. Then, of course, you
have to worry about name conversion between windows and linux but that gives
me headaches. The other day I could not run a command on a linux cdrom
mounted on another linux machine because the command, named COMMAND,
was interferred with by a data file named command or somesuch. So, be careful
before you install this stuff with a paying client.
Now, when to run this mount script is not clear. You could just make an icon
on the desktop for it, I suppose.
Joel
P.S. This is all "amateur" work.

_______________________________________________
http://linux.nf -- [EMAIL PROTECTED]
Archives, Subscribe, Unsubscribe, Digest, Etc 
->http://linux.nf/mailman/listinfo/linux-users

Reply via email to