From 22eb06e46953f2585ae0a62e60c1ce259fa51f8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 3 Feb 2016 22:00:35 +0100 Subject: [PATCH] Handle failures properly. --- docker.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 1.8.2.3