Committed by
Gerrit Code Review
Updating onos-secure-ssh to exit if known_hosts cannot be updated
Change-Id: I37865ca37db21ce6fe064676dc6f1bd94abe2044
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -10,7 +10,8 @@ nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2) | ... | @@ -10,7 +10,8 @@ nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2) |
10 | 10 | ||
11 | for node in $nodes; do | 11 | for node in $nodes; do |
12 | # Prune the node entry from the known hosts file since server key changes | 12 | # Prune the node entry from the known hosts file since server key changes |
13 | - ssh-keygen -f "$HOME/.ssh/known_hosts" -R [$node]:8101 | 13 | + ssh-keygen -f "$HOME/.ssh/known_hosts" -R [$node]:8101 || |
14 | + ( echo "Failed to remove key from known_hosts" >&2 && exit 1 ) | ||
14 | 15 | ||
15 | # Setup passwordless login for the local user on the remote node | 16 | # Setup passwordless login for the local user on the remote node |
16 | ssh $ONOS_USER@$node " | 17 | ssh $ONOS_USER@$node " | ... | ... |
-
Please register or login to post a comment