[Samba] Timing in a script
Hullen at t-online.de
Fri May 15 15:04:00 GMT 2009
Du meintest am 15.05.09:
> I am trying to write a script in which I can add users and their
> samba passwords easily and quickly. It looks something like:
> useradd -c "User Name" -g groupname -p unixpassword accountname
> echo -e "smbpassword\nsmbpassword\n" | pdbedit -a -t -u
> I type the lines from the keyboard, it works fine. However, when I
> try to execute the script, the pdbedit on the second line reports
> that there's no unix accountname to apply to samba. I assume that
> this is because the useradd process hasn't finished when the pdbedit
> is executed.
Maybe - sometimes I put a "sleep 30" between these 2 lines. "sleep 10"
wasn't always long enough.
More information about the samba