From e1df4a14d3d6db81a179faa360eb47f41b7b0cb2 Mon Sep 17 00:00:00 2001 From: geek Date: Wed, 6 Sep 2017 10:00:24 -0500 Subject: [PATCH] feat: default domain in setup --- gen-keys.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gen-keys.sh b/gen-keys.sh index f8b111b0..807c52d1 100755 --- a/gen-keys.sh +++ b/gen-keys.sh @@ -1,13 +1,20 @@ #!/bin/bash set -e -o pipefail -echo -n "Enter the domain name you plan to use for this key: " -read domain +TRITON_ACCOUNT=$(triton account get | awk -F": " '/id:/{print $2}') +TRITON_DC=$(triton profile get | awk -F"/" '/url:/{print $3}' | awk -F'.' '{print $1}') + +DEFAULT_DOMAIN=${TRITON_ACCOUNT}.${TRITON_DC}.cns.triton.zone + +read -p "Enter the domain name you plan to use for this key [$DEFAULT_DOMAIN]: " domain +domain="${domain:-$DEFAULT_DOMAIN}" echo -n "Enter the password to use for the key: " read -s password echo echo "Generating key for $domain" + + keys_path=keys-$domain mkdir -p $keys_path