12 lines
282 B
Bash
Executable file
12 lines
282 B
Bash
Executable file
#!/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}'
|