Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOLARIS 2.7/NIS QUESTION

Status
Not open for further replies.

youdaman

Technical User
Joined
Dec 26, 2001
Messages
66
Location
US
I am trying to automate the adding of users on our network via a script. The problem is Server #1 is the NIS server and Server #2 contains the user directories. I have the scripts running on server #1 but when I try to untar the newuser.tar file and rename to the user name, it will not let me do it. I have gone step by step after I have rsh into server #2 and all works ok.

if ( $1 == "") then
echo Usage: adduser username
exit 8
endif


echo
echo
echo CREATING DIRECTORIES AND CHANGING ATTRIBUTED SPECIFIC TO THE USER.....
sleep 3

#I tried putting rsh server#2 here but I get kicked out to the prompt on server #2
#If I rsh server #2 then run from here down, everything works fine.

cd /users/tssc/scripts
tar -xvf newuser.tar
mv newuser $1
pushd $1
sed "s/newuser/$1/" .forward.skel > .forward.tmp
mv .forward.tmp .forward.skel
popd
pushd $1/.netscape
sed "s/newuser/$1/" preferences.js > preferences.tmp
mv preferences.tmp preferences.js
popd
pushd $1
rm -r newuser
popd
chown -R $1 $1
mv $1 /users/tssc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top