From: zhuzeyu Date: Mon, 16 Jan 2017 12:31:53 +0000 (+0800) Subject: Add a judgment in trustme.sh X-Git-Tag: 1.0.0~54^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=9cfa59cf8b75d9ec23800b53f1ebf7728aeb4e82;p=daisy.git Add a judgment in trustme.sh To check whether the script runs successful Change-Id: I0ae4e01d845690cb6c19f95f0950cd98ebd1338c Signed-off-by: zhuzeyu --- 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 ..."