From 3d11005989805bd8d5dc728035ad4b9559554abb Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 3 Mar 2012 14:16:06 -0500 Subject: [PATCH] added handling of sourceforge sites. --- scripts/tty/ssh.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) mode change 100644 => 100755 scripts/tty/ssh.sh diff --git a/scripts/tty/ssh.sh b/scripts/tty/ssh.sh old mode 100644 new mode 100755 index 89bc923a..e26fd532 --- a/scripts/tty/ssh.sh +++ b/scripts/tty/ssh.sh @@ -4,9 +4,22 @@ # we want to fix any terminal titles that the foreign shells give us, and # this script is our chance to do so. -\ssh -i $HOME/.ssh/id_dsa_fred -X $* +#hmmm: not the slightest bit general here. +# what about having a main key variable and a sourceforge key variable? +# better yet, an array of site patterns and keys for those sites. -# re-run our terminal labeller. -bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh +keyfile="$HOME/.ssh/id_dsa_fred" + +if [ ! -z "$(echo $* | grep -i sourceforge)" ]; then + keyfile="$HOME/.ssh/id_dsa_sourceforge" +fi + +\ssh -i "$keyfile" -X $* + +if [ $? -eq 0 ]; then + # re-run the terminal labeller after coming back from ssh. + # we check the exit value because we don't want to update this for a failed connection. + bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh +fi -- 2.34.1