set -e
. "@commondir@/common.sh"
+# Check if the task should be prevented from running.
+check_if_excluded
+
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing."
fi
fi
# Remove non-default keys...
-grep ^HostKey "$config" | while read key_line; do
+grep ^HostKey "$config" || true | while read key_line; do
key=$(echo $key_line | cut -d" " -f2)
if [ "$key" = $HOST_KEY -o "$key" = $RSA_KEY -o \
"$key" = $DSA_KEY -o "$key" = $ECDSA_KEY ]; then
fi
else # do some guessing...
for i in rsa dsa ecdsa; do
- echo "$key" | grep _${i}_ && { type="$i"; break; }
+ if echo "$key" | grep _${i}_ > /dev/null; then
+ type="$i";
+ break;
+ fi
done
fi
if [ -z "$type" ]; then