script now exits remote host after initial ssh test
This commit is contained in:
parent
a21b2d36ad
commit
641efe906c
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
ssh_command="ssh -i $key_file $tilde_username@$tilde_name"
|
||||
ssh_command=""
|
||||
|
||||
check_key_file() {
|
||||
if [ -f "$key_file" ]
|
||||
|
@ -10,11 +10,12 @@ check_key_file() {
|
|||
echo "$key_file does not look like a private key file, try again"
|
||||
bash
|
||||
done
|
||||
ssh_command="ssh -i $key_file $tilde_username@$tilde_name"
|
||||
fi
|
||||
}
|
||||
|
||||
connection_test() {
|
||||
while ! $ssh_command "true"
|
||||
while ! "$ssh_command exit"
|
||||
do
|
||||
echo "There seems to be a problem connecting to the tilde"
|
||||
echo "Use this shell to try and fix any problems, then try connecting again by exiting the shell"
|
||||
|
|
Loading…
Reference in New Issue