aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/scripts
diff options
context:
space:
mode:
authorwu.zhihui <wu.zhihui1@zte.com.cn>2017-03-20 10:52:49 +0800
committerwu.zhihui <wu.zhihui1@zte.com.cn>2017-03-20 17:13:24 +0800
commiteaa225cf0c9b8b7bc63b35acdeef75dbacb8b905 (patch)
tree99a16254934b36c3914d1d665aea8a4145b7e8c7 /qtip/scripts
parent6694910aae48dd42e7c777e587c32e03cacd400c (diff)
mistaken delete usefuel public key
Previously, cleanup_creds.sh will delete public keys which of comment info is "root@$hostname". It could delete useful keys by accident. In this patch, cleanup_creds.sh will only delete the key which matches the key's content. JIRA: QTIP-228 Change-Id: I1095de656570b816b7e170688acd01c27b98e74c Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'qtip/scripts')
-rwxr-xr-xqtip/scripts/cleanup_creds.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/qtip/scripts/cleanup_creds.sh b/qtip/scripts/cleanup_creds.sh
index 1a7ddc1a..ad66ba95 100755
--- a/qtip/scripts/cleanup_creds.sh
+++ b/qtip/scripts/cleanup_creds.sh
@@ -10,11 +10,11 @@
DEST_IP=$1
PRIVATE_KEY=$2
-HOSTNAME=$(hostname)
+PUBLIC_KEY=$3
sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
case "$INSTALLER_TYPE" in
fuel)
- ssh $sshoptions -i $PRIVATE_KEY root@$DEST_IP "sed -i '/root@$HOSTNAME/d' /root/.ssh/authorized_keys"
+ ssh $sshoptions -i $PRIVATE_KEY root@$DEST_IP "sed -i '/$PUBLIC_KEY/d' /root/.ssh/authorized_keys"
;;
esac