Show connection details on abra server ls

Closes coop-cloud/abra#110.
This commit is contained in:
decentral1se 2021-03-18 18:46:33 +01:00
parent 89bd18a76b
commit 87b71cb9d4
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A

17
abra
View File

@ -1565,10 +1565,23 @@ List locally-defined servers."
sub_server_list() { sub_server_list() {
get_servers get_servers
warning "Loading status from ${#SERVERS[@]} server(s), patience advised.."
printf "%s servers:\n\n" "${#SERVERS[@]}" printf "%s servers:\n\n" "${#SERVERS[@]}"
local -a idx=0
for SERVER in "${SERVERS[@]}"; do for SERVER in "${SERVERS[@]}"; do
echo " ${SERVER##*/}" if [[ "$idx" == 0 ]]; then
done printf " NAME\tCONNECTION\n"
printf " --\t--\t\n"
fi
name="${SERVER##*/}"
host=$(docker context inspect "$name" -f "{{.Endpoints.docker.Host}}" 2>/dev/null)
printf " %s\t%s\t%s%s\n" "$name" "${host:-UNKNOWN}"
idx+=1
done | column -s' ' -t
} }
###### .. server init ###### .. server init