From: Chris Koeritz Date: Sat, 3 Mar 2012 19:16:06 +0000 (-0500) Subject: added handling of sourceforge sites. X-Git-Tag: 2.140.90~1534 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=3d11005989805bd8d5dc728035ad4b9559554abb;p=feisty_meow.git added handling of sourceforge sites. --- 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