parameterize more values

This commit is contained in:
Pim Kunis 2023-04-05 17:12:16 +02:00
parent d41794e65d
commit 20199a65f4
3 changed files with 43 additions and 14 deletions

View file

@ -2,11 +2,9 @@
set -euo pipefail
IFS=$'\n\t'
CAHOST=root@hermes.dmz
eval "$(jq -r '@sh "PUBKEY=\(.pubkey) HOST=\(.host)"')"
eval "$(jq -r '@sh "PUBKEY=\(.pubkey) HOST=\(.host) CAHOST=\(.cahost)"')"
# TODO: Can this be done more eye-pleasingly?
CERT=$(ssh $CAHOST '/root/ca.sh host "'"$PUBKEY"'" "'"$HOST"'".dmz')
CERT=$(ssh root@$CAHOST '/root/ca.sh host "'"$PUBKEY"'" "'"$HOST"'".dmz')
jq -n --arg cert "$CERT" '{"cert":$cert}'