1835336 Members
2873 Online
110078 Solutions
New Discussion

Change Login Prompt.

 
NS_2
Occasional Contributor

Change Login Prompt.

Hi Masters
Does any body knows how to change login prompt. (login: )

If DataBase is UP => DBS=UP
Down => DBS=DN
I want to put database status alongwith login: prompt.

eg.
DataBase $DBS login:

Thanks in adv.
Take It Easy, Be Happy !
3 REPLIES 3
Rodney Hills
Honored Contributor

Re: Change Login Prompt.

You could add that information to /etc/issue and be sure that within the file /etc/inetd.conf you have a line that looks like the following-

telnet stream tcp nowait root /usr/lbin/telnetd telnetd -b /etc/issue

HTH

-- Rod Hills
There be dragons...
someone_4
Honored Contributor

Re: Change Login Prompt.

You can do the following in the /etc/profile or per user in the .profile in the home directory.

The follwoing will make your promt look like so:

(lvapp11) /var/adm



HOST="<`hostname |cut -d"." -f1`>"

if [ "$LOGNAME" = "root" ]; then
PROMT="#"
else
PROMT=">"
fi

PS1='${HOST} ${PWD}${PROMT} '
PS2='${HOST} ${PWD}> '
export PS1 PS2
trap 1 2 3

From here you should be able to run the command ot check your database and put it in the promt the way you like it.

~ Richard
Ray Brewer
Valued Contributor

Re: Change Login Prompt.

Just to add a bit, the file you use is not limited to /etc/issue. You can create a file of your own. See the man page on telnetd for instructions. Either way what you would see is something like this

Database $DBS
login: