creating batch file for logon script...

Mark Montazer mdmontazer at confluencewatersports.com
Tue Sep 25 10:35:04 GMT 2001


Here's a script I use, granted, there's no error checking and you have to
remember the parameters, but time is short and bosses don't ever see the
usefulness of such things.  Just plop it in /usr/sbin or wherever your path
points, and it'll do the rest for you.  I call it adddomuser:

------------------------begin script--------------------------
#!/bin/bash

useradd -c "$1 $2 $3" -d /home/$4 -g $5 -s /bin/bash $4

# format: First Name, Middle Initial, Last Name, username, group

echo "net time \\\siddhartha /set /yes" > /usr/local/samba/netlogon/$4.bat
echo "net use h: \\\siddhartha\\$4" >> /usr/local/samba/netlogon/$4.bat
echo "net use i: \\\siddhartha\\$5" >> /usr/local/samba/netlogon/$4.bat
echo "net use j: \\\siddhartha\\confluence" >>
/usr/local/samba/netlogon/$4.bat

unix2dos /usr/local/samba/netlogon/$4.bat
chmod 777 /usr/local/samba/netlogon/$4.bat

smbpasswd -a $4
----------------------end script--------------------------------

Thanks,
Mark


-----Original Message-----
From: samba-admin at lists.samba.org [mailto:samba-admin at lists.samba.org]On
Behalf Of Sano B Rutsen
Sent: Tuesday, September 25, 2001 11:56 AM
To: samba
Subject: Re: creating batch file for logon script...


I agree with you, but then im planning to write a script that would
automate the creation of the batch file, so that every time I have
to add a user i dont have to manually create the file in notepad for
all the users, just to copy it to the linux box.

This way everytime i add a user for samba, a dos formatted script is
automatically created without leaving my linux box,(very convenient if
I have many users).

But then again, I can see your point. Im doing this for a home network
with no more than 20 users... hehe... Anyways, i like doing things
for fun.


Thanx!


Best Regards,

Sano


=?iso-8859-1?Q?Wilmar_P=E9rez?= wrote:

>Hi Sano
>
>Well, your friend's right.  But you don't need any other program.  You
>just've got to edit the file in a DOS or Windows plain text editor and the
>send it to the Linux box, that's it.
>
>Bye


__________________________________
www.edsamail.com

--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba





More information about the samba mailing list