freebsd new users script
I wasnt really sure where to post this tread, but anways . .
I writing a bash script to allow people to add users, to the system, they run this script and this script creates and writes to newusers.txt and userpass.txt , then i have a con job that runs about every second as root that runs a script that gets the user info from the 2 files
(this script is a login shell for the user new)
new user shell creates and makes an entry to newusers.txt like this
***************
-g unreg -d /home/public/test/ -m -s /bin/sh -n test
***************
and a entry in userpass.txt like this
***************
[ssl encyrpted pass] test
***************
all that works fine
the con job script contains the following lines
****************
if test -e /home/public/.new/newusers.txt # if test file exist
then
userinfo=$(cat /home/public/.new/newusers.txt)
userpass=$(cat /home/public/.new/userpass.txt)
pw useradd "$userinfo"
chpass -p "$userpass"
rm /home/public/.new/newusers.txt
rm /home/public/.new/userspass.txt
else
exit #do nothing
fi
*****************
the problem is that every time i test the con job script in the terminal
it creates a promt at the terminal, and i dont while or what it's waiting for,
this script is supposed to be non-interactive
can some one help me?
thanks
note: this program worked under linux, but now i'm rewriting it for freebsd
|