To check whether the script runs successful
Change-Id: I0ae4e01d845690cb6c19f95f0950cd98ebd1338c
Signed-off-by: zhuzeyu <zhu.zeyu@zte.com.cn>
#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 ..."