gen_metada.sh: Check commands exist
This commit is contained in:
parent
1afbab32dd
commit
f6bb741070
@ -14,6 +14,7 @@ SSH_PATH="${SSH_PATH:-/tmp/fic_ssh}"
|
|||||||
DHPARAM_PATH="${DHPARAM_PATH:-/tmp/dhparam.pem}"
|
DHPARAM_PATH="${DHPARAM_PATH:-/tmp/dhparam.pem}"
|
||||||
OUTPUT_PATH="${OUTPUT_PATH:-"$(mktemp -d)"}"
|
OUTPUT_PATH="${OUTPUT_PATH:-"$(mktemp -d)"}"
|
||||||
|
|
||||||
|
command -v vault &> /dev/null || (echo "vault could not be found" && exit)
|
||||||
vault login -method=oidc -no-print 2> /dev/null
|
vault login -method=oidc -no-print 2> /dev/null
|
||||||
|
|
||||||
export DM_CRYPT="$(tr -d -c "a-zA-Z0-9" < /dev/urandom | fold -w512 | head -n 1)"
|
export DM_CRYPT="$(tr -d -c "a-zA-Z0-9" < /dev/urandom | fold -w512 | head -n 1)"
|
||||||
@ -30,6 +31,7 @@ export SYNCRO_PRIVATE_KEY="$(cat "$SSH_PATH" | escape_newline)"
|
|||||||
|
|
||||||
echo -e "\n\nGenerating DH params please wait"
|
echo -e "\n\nGenerating DH params please wait"
|
||||||
|
|
||||||
|
command -v openssl &> /dev/null || (echo "openssl could not be found" && exit)
|
||||||
openssl dhparam -out "$DHPARAM_PATH" 4096 &>/dev/null
|
openssl dhparam -out "$DHPARAM_PATH" 4096 &>/dev/null
|
||||||
export DHPARAM="$(cat "$DHPARAM_PATH" | escape_newline)"
|
export DHPARAM="$(cat "$DHPARAM_PATH" | escape_newline)"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user