Listing 6 .bash_logout
#####################################################################
# File Name: .bash_logout
# Location: Cygwin user's home directory
# Purpose: This file is sourced when a Cygwin bash shell exit
#####################################################################
# Check to see if we're running under Cygwin.
if uname -s | fgrep -q CYGWIN
then
unset REPLY
# Prompt the user for input, with a 5-second timeout.
read -t5 -n1 -p "Stop keychain? [y/N] "
# If user does not stop keychain, display an error message that will
# remain on-screen if the Cygwin window hangs.
if [ "$(echo $REPLY | tr Y y)" == "y" ]; then
echo
keychain --stop
sleep 1
else
echo
echo "This window may hang under Cygwin if ssh-agent was initally"
echo "run from this tty [$(tty)] and is still running. Either"
echo -n "close the window manually, or kill ssh-agent process "
echo "$(ps | fgrep ssh-agent | awk '{print $1}')"
echo "from another Cygwin window."
fi
fi
|