Revision fe816d8b

b/snf-image-helper/tasks/40DeleteSSHKeys.in
69 69
fi
70 70

  
71 71
# Remove non-default keys...
72
grep ^HostKey "$config" | while read key_line; do
72
grep ^HostKey "$config" || true | while read key_line; do
73 73
    key=$(echo $key_line | cut -d" " -f2)
74 74
    if [ "$key" = $HOST_KEY -o "$key" = $RSA_KEY -o \
75 75
            "$key" = $DSA_KEY -o "$key" = $ECDSA_KEY ]; then
......
91 91
            fi
92 92
        else # do some guessing...
93 93
            for i in rsa dsa ecdsa; do
94
                echo "$key" | grep _${i}_ && { type="$i"; break; }
94
                if echo "$key" | grep _${i}_ > /dev/null; then
95
                    type="$i";
96
                    break;
97
                fi
95 98
            done
96 99
        fi
97 100
        if [ -z "$type" ]; then

Also available in: Unified diff