stockholm/bin/cac-get-server-by
2015-05-21 01:56:08 +02:00

16 lines
205 B
Bash
Executable File

#! /bin/sh
set -euf
cac-listservers \
| jq \
--arg k "$1" \
--arg v "$2" \
'
map(select(.[$k]==$v)) |
if (. | length) == 1 then
.[0]
else
.
end
'