|
|||
|
The title says it all. I recently put `exec screen -R` in my .bash_profile, and that's the only change I've made. I have disconnected/reconnected several times since then.
Specifically: I get a login prompt, type my username, type my valid password, and see my 'last login' message before the puTTY window closes. If I type the incorrect password I get 'access denied' and get to try again (no disconnect until I login). OS: Fedora 9 I believe. Any ideas? |
|
|||
|
screen's default behavior will kill your present TTY session when run from a .bash_profile or .bashrc script as soon as screen successfully runs.
If you plan to experiment with your login scripts, I would highly recommend adding a sleep 5 call before the experimental commands in your login script (this will give you a chance to break from the script back to the shell if you find that subsequent commands have an undesirable effect). You will also want to use a comparison to ensure that your screen sessions do not start screen sessions ![]() Code:
if [ $TERM != "screen" ]; then echo -n "Ctrl-C now to avoid screen - in 5 secs..." && sleep 1 && echo -n " 4 secs..." && sleep 1 && echo -n " 3 secs..." && sleep 1 && echo -n " 2 secs..." && sleep 1 && echo -n " 1 sec..." && sleep 1 && screen -D -RR else echo "Running in screen session..." fi Last edited by DanL@VPSLink; 09-21-2009 at 03:02 PM. |
|
|||
|
You are most welcome - here's a more configurable alternative, should you want to experiment:
Code:
# screen autostart
if [ $TERM != "screen" ]; then
# Configuration
SCRAUTO_CMD='screen -D -RR'
SCRAUTO_DELAY=10
# EOF - Configuration
SCRAUTO_DISPLAY=$SCRAUTO_DELAY+1
echo -n "(Ctrl+C to skip) Running "${SCRAUTO_CMD}" in "
for (( i=0; i<=$SCRAUTO_DELAY; i++ ))
do
let SCRAUTO_DISPLAY=SCRAUTO_DISPLAY-1
echo -n ${SCRAUTO_DISPLAY}"... "
sleep 1
done
${SCRAUTO_CMD}
else
echo "Running in screen session..."
fi
|
|
|||
|
... our support manager has informed me that screen -D -R added at the end of your .bash_profile script should accomplish everything the above script does in about 6% of the lines (see man screen for "Author's favorite" for full details).
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|