[Samba] Script question

Scott Wrosch swrosch at MarketingAssociates.com
Tue Oct 29 15:38:34 GMT 2002


Hello,

I've got the following script that I want to run every time a user logs in to the Samba server, whether it be from a mapped share or by opening a telnet session into the server and logging in that way.

Here's the script:

#!/bin/sh

DOMAIN=`echo $USER | awk -F_ '{print $1}'`
USERNAME=`echo $USER | awk -F_ '{print $2}'`

if [ $DOMAIN = "MA" ]; then
  if [ -d /home/$DOMAIN/$USERNAME ]; then
    continue
  else
    mkdir /home/$DOMAIN/$USERNAME
  fi
fi

It's not the prettiest, but it does what I want, which is create the users home directory if it doesn't exist.

Now, I know there were a couple of options in the smb.conf file for doing this, but I can't get it to cooperate.  Can anyone help, or offer an alternate means?

Thanks and regards,

Scott Wrosch
desk 248.333.7700 x227
pager 248.806.7657
text 2488067657 at paging.acswireless.com
email swrosch at marketingassociates.com
 
"Our greatest glory is not in never falling
but in rising every time we fall." -- Confucius




More information about the samba mailing list