fix: add missing awk to get number of lines in key file

This commit is contained in:
Jose Diaz-Gonzalez
2019-05-12 19:08:55 -04:00
parent 6ca4813247
commit dee0144c7c

View File

@@ -28,7 +28,7 @@ add_keys() {
dokku_log_fail "Empty key was specified"
fi
local count="$(wc -l "$KEY_FILE")"
local count="$(wc -l "$KEY_FILE" | awk '{ print $1; }')"
[[ "$count" -eq 1 ]] || dokku_log_fail "Too many keys provided, set one per invocation of dokku ssh-keys:add <NAME> <KEY_FILE>"
ssh-keygen -lf "$KEY_FILE" &>/dev/null || dokku_log_fail "Key specified in is not a valid ssh public key"
create_ssh_key_file