From: František Dvořák Date: Wed, 3 Feb 2016 21:00:35 +0000 (+0100) Subject: Handle failures properly. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=22eb06e46953f2585ae0a62e60c1ce259fa51f8b;p=virtualization.git Handle failures properly. --- diff --git a/docker.sh b/docker.sh index 0755de6..fdbe05c 100755 --- a/docker.sh +++ b/docker.sh @@ -88,9 +88,12 @@ if [ -n "${FETCH_SSH_KEYS}" ]; then for j in '' '.pub'; do for i in rsa dsa ecdsa; do (umask 0177; rsh -5 -f -u -x -p 5665 kdccesnet.ics.muni.cz /usr/local/bin/rsh.getsshhostkey ${FACTER_fqdn} ssh_host_${i}_key${j} > ${config_dir}/ssh/ssh_host_${i}_key${j}) + if [ ! -s ${config_dir}/ssh/ssh_host_${i}_key${j} ]; then + rm ${config_dir}/ssh/ssh_host_${i}_key${j} + fi done done - chmod 0644 ${config_dir}/ssh/*.pub + chmod 0644 ${config_dir}/ssh/ssh_host_*.pub 2>&1 || : fi fi if [ -f "${config_dir}/../.k5login" ]; then