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