row_process
This commit is contained in:
@@ -44,32 +44,41 @@ check_ssh_files() {
|
|||||||
printf "%-17b %-20s %-6s %s\n" " $RED_X" "$key" "-" "(not configured)"
|
printf "%-17b %-20s %-6s %s\n" " $RED_X" "$key" "-" "(not configured)"
|
||||||
}
|
}
|
||||||
|
|
||||||
row_process() {
|
get_key_status() {
|
||||||
local key="$1"
|
local path="$1"
|
||||||
|
|
||||||
if [[ -z "$key" ]]; then
|
|
||||||
echo "usage: row_process <key>" >&2
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
path=$(ssh_config_val "$key")
|
|
||||||
|
|
||||||
if [[ -z "$path" ]]; then
|
if [[ -z "$path" ]]; then
|
||||||
row_unconfigured $key
|
echo "unconfigured"
|
||||||
continue
|
elif [[ ! -e "$path" ]]; then
|
||||||
fi
|
echo "missing"
|
||||||
|
|
||||||
if [[ -e "$path" ]]; then
|
|
||||||
row_success $key $path
|
|
||||||
else
|
else
|
||||||
row_fail $key $path
|
echo "success"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
row_process() {
|
||||||
|
local key="$1"
|
||||||
|
local path=$(ssh_config_val "$key")
|
||||||
|
local status=$(get_key_status "$path")
|
||||||
|
case "$status" in
|
||||||
|
success) row_success "$key" "$path" ;;
|
||||||
|
missing) row_fail "$key" "$path" ;;
|
||||||
|
unconfigured) row_unconfigured "$key" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
printf "%-6s %-20s %-6s %s\n" "STATUS" "KEY" "PERMS" "PATH"
|
printf "%-6s %-20s %-6s %s\n" "STATUS" "KEY" "PERMS" "PATH"
|
||||||
row_process "hostkey"
|
|
||||||
row_process "hostcertificate"
|
# hostkey
|
||||||
row_process "trustedusercakeys"
|
key="hostkey"
|
||||||
|
row_process $key
|
||||||
|
|
||||||
|
# hostcertificate
|
||||||
|
key="hostcertificate"
|
||||||
|
row_process $key
|
||||||
|
|
||||||
|
# trustedusercakeys
|
||||||
|
key="trustedusercakeys"
|
||||||
|
row_process $key
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_fingerprint() {
|
ssh_fingerprint() {
|
||||||
|
|||||||
Reference in New Issue
Block a user