Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I solved the problem somehow.

first I make desired ttys login automatically by changing /etc/inittab, change below :

2:2345:respawn:/sbin/mingetty tty2 -> 2:2345:respawn:/sbin/mingetty tty2 --autologin USER_NAME

then I make a script which check tty index and execute command on a tty which I wanted to, code below :

if [[ $(tty) = /dev/tty2 ]]; then MY_COMMAND fi

then I just put my script at /root/.bash_profile

I solved the problem somehow.

first I make desired ttys login automatically by changing /etc/inittab, change below :

2:2345:respawn:/sbin/mingetty tty2tty[1-6] -> 2:2345:respawn:/sbin/mingetty tty2 tty[1-6] --autologin USER_NAME

then I make a script which check tty index and execute command on a tty which I wanted to, code below :

if [[ $(tty) = /dev/tty2 /dev/tty[1-6] ]]; then MY_COMMAND fi

then I just put my script at /root/.bash_profile