On Thu, 3 Oct 2002, John Clay wrote:
> I found some references that noted that an /etc/fstab entry was needed so I
> added the following line to it:
> Also found reference that suid needed to be set for the
> /usr/sbin/smb*-collection-of-executables so I did that too.

I haven't needed to do either of these...

I'm using the following scripts to mount and unmount shared NT user home
directories on a mount point in the users (linux) home directory.
I think that makes sense. :-)

To mount their NT home directory, the user runs the command 'mount-home'.
This then checks to see if the mount point exists and is not already
mounted. It then asks for their NT password and mounts the directory.
'unmount-home' does exactly what it says on the tin. :-)

I'm fairly sure both of these came from this list, but I can't remember
who originally posted them. Sorry.



/usr/local/bin/mount-home

#!/bin/sh
#
# Mount NT home directory
#
#

CURR_USER=`whoami`
umask 077

nthome="//hhfs1/${CURR_USER}$"
unixmnt="/home/${CURR_USER}/windows-home"

if [ -d $unixmnt ]; then
   echo "$unixmnt exists"
else
   echo "Creating mount point $unixmnt..."
   mkdir $unixmnt
   chown ${CURR_USER}:${CURR_USER} $unixmnt
fi

echo " "
nthome_check=`df |grep $unixmnt |cut -f1 -d" "`

if [ "$nthome_check" != "$nthome" ]; then
  echo "Mounting Windows home directory for ${CURR_USER}..."
  echo "Enter your Windows password at the prompt:"
  echo " "
  smbmount $nthome $unixmnt -o workgroup=HUGHES_HALL, username=$CURR_USER
  echo " "
else
  echo "Windows home directory for ${CURR_USER} is already mounted at
$unixmnt"
  status="finished"
fi

#---------------------------------------------------------------
# Check again to make sure unix home dir is successfully mounted
# If not, clear the mount point using smbumount command, and
# prompt user to rerun the script
#---------------------------------------------------------------
if [ "$status" != "finished" ] ;then
  unixhome_check=`df |grep $unixmnt |cut -f1 -d" "`
  if [ "$unixhome_check" = "$nthome" ] && [ -d $unixmnt ] ;then
    echo "Your Windows home directory is: $unixmnt"
    echo " "
  else
    echo "Mount failed, rerun the script."
    smbumount $unixmnt
  fi
fi

# end of mount-home

/usr/local/bin/unmount-home

#!/bin/sh
#
# Unmount NT home directory
#
#

CURR_USER=`whoami`
umask 077

unixmnt="/home/${CURR_USER}/windows-home"

if [ -d $unixmnt ]; then
  smbumount $unixmnt
  echo "Unmounting home directory: $unixmnt "
else
   echo "Your home directory is not currently mounted."
fi

# end of unmount-home


-- 
Phil Davey
Computer Officer
Hughes Hall College, Cambridge
Email [EMAIL PROTECTED]




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.openprojects.net

Reply via email to