summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorMatt Goins <mjgoins@openflows.com>2008-11-16 11:18:38 -0500
committerMatt Goins <mjgoins@openflows.com>2008-11-16 11:18:38 -0500
commite7c994d6f67d380ed0de21f1500ec395eaab6640 (patch)
treee4c81a45e2dcfdd46409beab222d122751f5f6d7 /src/common
parent9aec501a27b51523165a05c4c4da0cc9251424e8 (diff)
parent5d9949335aeb1dec04f530cbb3dfcac24288706a (diff)
Merge commit 'dkg/master'
Diffstat (limited to 'src/common')
-rw-r--r--src/common11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common b/src/common
index 297e7f3..efee9bd 100644
--- a/src/common
+++ b/src/common
@@ -742,6 +742,7 @@ process_user_id() {
process_host_known_hosts() {
local host
local userID
+ local noKey=
local nKeys
local nKeysOK
local ok
@@ -768,8 +769,9 @@ process_host_known_hosts() {
continue
fi
- # remove the old host key line, and note if removed
- remove_line "$KNOWN_HOSTS" "$sshKey"
+ # remove any old host key line, and note if removed nothing is
+ # removed
+ remove_line "$KNOWN_HOSTS" "$sshKey" || noKey=true
# if key OK, add new host line
if [ "$ok" -eq '0' ] ; then
@@ -788,6 +790,11 @@ process_host_known_hosts() {
else
ssh2known_hosts "$host" "$sshKey" >> "$KNOWN_HOSTS"
fi
+
+ # log if this is a new key to the known_hosts file
+ if [ "$noKey" ] ; then
+ log info "* new key for $host added to known_hosts file."
+ fi
fi
done