]> git.street.me.uk Git - andy/dehydrated.git/commitdiff
when using printf, we do not need inline expansion of variables
authorDirk Engling <erdgeist@erdgeist.org>
Sat, 19 Dec 2015 22:26:49 +0000 (23:26 +0100)
committerDirk Engling <erdgeist@erdgeist.org>
Sat, 19 Dec 2015 22:26:49 +0000 (23:26 +0100)
letsencrypt.sh

index 30507f5aaff5d0e5e545949fdc22d72493475f46..7164db33397136de922e259eec7d40a77f34f4a4 100755 (executable)
@@ -130,7 +130,7 @@ init_system() {
   pubExponent64="$(printf "%06x" "$(openssl rsa -in "${PRIVATE_KEY}" -noout -text | grep publicExponent | head -1 | cut -d' ' -f2)" | hex2bin | urlbase64)"
   pubMod64="$(printf '%s' "$(openssl rsa -in "${PRIVATE_KEY}" -noout -modulus | cut -d'=' -f2)" | hex2bin | urlbase64)"
 
-  thumbprint="$(printf '%s' '{"e":"'"${pubExponent64}"'","kty":"RSA","n":"'"${pubMod64}"'"}' | openssl sha -sha256 -binary | urlbase64)"
+  thumbprint="$(printf '{"e":"%s","kty":"RSA","n":"%s"}' "${pubExponent64}" "${pubMod64}" | openssl sha -sha256 -binary | urlbase64)"
 
   # If we generated a new private key in the step above we have to register it with the acme-server
   if [[ "${register}" = "1" ]]; then