diff options
author | zhuzeyu <zhu.zeyu@zte.com.cn> | 2017-01-16 20:31:53 +0800 |
---|---|---|
committer | zhuzeyu <zhu.zeyu@zte.com.cn> | 2017-02-06 12:47:29 +0800 |
commit | 9cfa59cf8b75d9ec23800b53f1ebf7728aeb4e82 (patch) | |
tree | 8a500600ce79c4a85ac8a0927ab0b437672f9a34 /deploy | |
parent | b40b7d7c6770fc3f1f39f9b7b576a88c1ce87864 (diff) |
Add a judgment in trustme.sh
To check whether the script runs successful
Change-Id: I0ae4e01d845690cb6c19f95f0950cd98ebd1338c
Signed-off-by: zhuzeyu <zhu.zeyu@zte.com.cn>
Diffstat (limited to 'deploy')
-rwxr-xr-x | deploy/trustme.sh | 6 |
1 files changed, 5 insertions, 1 deletions
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 ..." |