diff --git a/scripts/ssh-server-check.sh b/scripts/ssh-server-check.sh index ebbbe21..b535e87 100755 --- a/scripts/ssh-server-check.sh +++ b/scripts/ssh-server-check.sh @@ -44,9 +44,16 @@ check_ssh_files() { printf "%-17b %-20s %-6s %s\n" " $RED_X" "$key" "-" "(not configured)" } - printf "%-6s %-20s %-6s %s\n" "STATUS" "KEY" "PERMS" "PATH" - for key in hostkey hostcertificate trustedusercakeys; do + row_process() { + local key="$1" + + if [[ -z "$key" ]]; then + echo "usage: row_process " >&2 + return 2 + fi + path=$(ssh_config_val "$key") + if [[ -z "$path" ]]; then row_unconfigured $key continue @@ -57,7 +64,12 @@ check_ssh_files() { else row_fail $key $path fi - done + } + + printf "%-6s %-20s %-6s %s\n" "STATUS" "KEY" "PERMS" "PATH" + row_process "hostkey" + row_process "hostcertificate" + row_process "trustedusercakeys" } ssh_fingerprint() {