LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2003, 10:57 PM   #1
evilchild
Member
 
Registered: Sep 2003
Location: 127.0.0.1
Distribution: *bsd, solaris, gentoo
Posts: 86

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems adding/removing users in FreeBSD asilentmurmur *BSD 14 10-26-2005 05:43 PM
Here is help for New FreeBSD users, info, links teckk *BSD 1 05-02-2005 06:14 AM
Transfering many users accounts from a FreeBSD 4.4 box to another one stepbysteph *BSD 1 11-09-2003 12:26 PM
Perl script not running on FreeBSD J_Szucs *BSD 12 07-13-2002 09:05 AM
E-Mail notification to users via SMS (gateway script ok, but notification script?!?) Riku2015 Linux - Networking 10 03-08-2002 10:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration