10 lines
281 B
Bash
Executable file
10 lines
281 B
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
eval "$(jq -r '@sh "PUBKEY=\(.pubkey) HOST=\(.host) CAHOST=\(.cahost)"')"
|
|
|
|
# TODO: Can this be done more eye-pleasingly?
|
|
CERT=$(ssh root@$CAHOST '/root/ca.sh host "'"$PUBKEY"'" "'"$HOST"'".dmz')
|
|
|
|
jq -n --arg cert "$CERT" '{"cert":$cert}'
|