samba share setup on linux clients

jbk jbk-SkCWf5sxpj0sV2N9l4h3zg at public.gmane.org
Tue Jan 20 06:40:31 EST 2009


> collecting user data. Unfortunately, gnome does not provide 
> a mechanism to add a logout script and .bash_logout is not 
> read because the shell is not a login shell. So the first 
> script has to test for the mount point if the server is not 
> available and delete the lingering mount points. Anyway I'll 
> post the script when I have it working for both conditions.
> 
> Jim KR

Here is the share mount script so far. I want to now make a 
for loop that takes share names as an arguments when it the 
script is called.

##########################################################
# This script will test for bagend on the network and then 
mount shares or
# issue an error message

if ping  -w 2 -c 1 bagend && smbclient -NL bagend; then
    echo "bagend is present"
    mkdir ~/k-rdat ~/frodo
    mount.cifs //bagend/k-rdat ~/k-rdat -o 
credentials=~/.samba/.$USERNAME
    mount.cifs //bagend/frodo ~/frodo -o 
credentials=~/.samba/.$USERNAME

else
     echo "The server bagend could not be reached. Is it on?"

fi

###########################################################

I also figured out a crude logout script that I made a ling 
to on the gnome panel.

##########################################################

# this program un-mounts network shares and then calls 
gnome-session-save
# with the --logout option

if [ -d ~/k-rdat ]; then
     /sbin/umount.cifs /home/$USERNAME/k-rdat
     wait=1
     /sbin/umount.cifs /home/$USERNAME/frodo
     wait=1
     rmdir /home/$USERNAME/frodo /home/$USERNAME/k-rdat
fi

/usr/bin/gnome-session-save --logout

###############################################################

This script also needs a for loop to simplify it's 
administration. I have tested this for conditions when the 
server is reachable or not without any hangs yet. I have not 
figured out how to un mount the shares when I hybernate yet, 
but the main target for this script is a desktop with 
multiple users.

Jim KR





More information about the Discuss mailing list