0c7897c43b2c549d8676c3cc825b43d118f53a04
[feisty_meow.git] / scripts / customize / fred / scripts / ssh.sh
1 #!/bin/bash
2
3 # wraps calling the secure shell to let us pick our appropriate credentials.
4
5 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
6 source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh"
7
8 #hmmm: is this still used???
9 #  it seems redundant with the ssh config file that says which creds to use.
10 source "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/pick_credentials.sh"
11
12 # remember the old title.
13 save_terminal_title
14
15 # force the TERM variable to a more generic version for other side.
16 # we don't want the remote side still thinking it's running xterm.
17 export TERM=linux
18
19 #hmmm: it would be good to set an interrupt handler here and
20 #      trap ctrl-c, since otherwise we are getting exited from and losing a chance
21 #      to reset the terminal title.  this actually happens a lot, since some X11
22 #      or other background process is left running and the ssh never actually quits,
23 #      forcing one to hit ctrl-c.
24
25 if [ ! -z "$keyfile" ]; then
26   \ssh -i "$keyfile" -X -C $*
27 else
28   \ssh -X -C $*
29 fi
30
31 restore_terminal_title
32