X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ftty%2Fssh.sh;h=e26fd532dad556fa92a18c26e01a1482797c9264;hb=822d21fe89e414db3f252501194fb4ca93e3e405;hp=896afa4d2bf5e30c60ca869059a127cfa8a6d793;hpb=2952ccf47b80174880141a7ecfa122089f349b8d;p=feisty_meow.git diff --git a/scripts/tty/ssh.sh b/scripts/tty/ssh.sh old mode 100644 new mode 100755 index 896afa4d..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 $SHELLDIR/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