From 9cfa59cf8b75d9ec23800b53f1ebf7728aeb4e82 Mon Sep 17 00:00:00 2001 From: zhuzeyu Date: Mon, 16 Jan 2017 20:31:53 +0800 Subject: Add a judgment in trustme.sh To check whether the script runs successful Change-Id: I0ae4e01d845690cb6c19f95f0950cd98ebd1338c Signed-off-by: zhuzeyu --- deploy/trustme.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/trustme.sh b/deploy/trustme.sh index a0414fd9..38e2d838 100755 --- a/deploy/trustme.sh +++ b/deploy/trustme.sh @@ -48,7 +48,11 @@ fi #clear old public key print_log "clear old info in known_hosts file on localhost ..." -ssh-keygen -R $ip +test ! -f ~/.ssh/known_hosts || ssh-keygen -R $ip +if [ $? != 0 ]; then + print_log "clear old info in known_hosts file on localhost failed" + exit 1 +fi #copy new public key print_log "copy my public key to $ip ..." -- cgit 1.2.3-korg