1832346 Members
2169 Online
110041 Solutions
New Discussion

login scripts

 
dhanish
Regular Advisor

login scripts

Hi,
I need to write a login script which will set some env. params whenever the user login.
Can anybody suggest any template ...for that.

thnks
Never Say Die
3 REPLIES 3
Stefan Farrelly
Honored Contributor

Re: login scripts


Use the following file as a template - thats what its for;

/usr/newconfig/.profile

And edit it and add any environmental variables or commands you want to run at the bottom of it then copy to users home directories. This is the normal procedure for doing what you want.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Steve Steel
Honored Contributor

Re: login scripts

Hi

Write a seperate script . can be different for each user . Directory /usersetup File=$LOGNAME

Then in /etc/profile at end

if [ -x /usersetup/$LOGNAME ]
then
. /usersetup/$LOGNAME
fi


Everybody runs /etc/profile and then if a
user needs special setup it will happen.

Note. 1 . The script must be executable
2. The . in the beginning of the line
which adds the data at the current process level.

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Michael Tully
Honored Contributor

Re: login scripts

Hi,

Once your script has been written as
a default profile, you could use it
in /etc/skel/profile. Once used it can
be deployed to new users on your system.
As suggested you can use the template
that is provided.

Cheers
~Michael~
Anyone for a Mutiny ?