16 lines
205 B
Bash
Executable File
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
|
|
'
|