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