-
-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
…ing ignore case option (-i) to grep's.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -409,7 +409,7 @@ init_system() { | |
if [[ ${API} -eq 1 ]]; then | ||
_exiterr "This is not implemented for ACMEv1! Consider switching to ACMEv2 :)" | ||
else | ||
ACCOUNT_URL="$(signed_request "${CA_NEW_ACCOUNT}" '{"onlyReturnExisting": true}' 4>&1 | grep ^Location: | awk '{print $2}' | tr -d '\r\n')" | ||
ACCOUNT_URL="$(signed_request "${CA_NEW_ACCOUNT}" '{"onlyReturnExisting": true}' 4>&1 | grep -i ^Location: | awk '{print $2}' | tr -d '\r\n')" | ||
ACCOUNT_INFO="$(signed_request "${ACCOUNT_URL}" '{}')" | ||
fi | ||
ACCOUNT_ID="${ACCOUNT_URL##*/}" | ||
|
@@ -579,9 +579,9 @@ signed_request() { | |
|
||
# Retrieve nonce from acme-server | ||
if [[ ${API} -eq 1 ]]; then | ||
nonce="$(http_request head "${CA}" | grep Replay-Nonce: | awk -F ': ' '{print $2}' | tr -d '\n\r')" | ||
nonce="$(http_request head "${CA}" | grep -i Replay-Nonce: | awk -F ': ' '{print $2}' | tr -d '\n\r')" | ||
else | ||
nonce="$(http_request head "${CA_NEW_NONCE}" | grep Replay-Nonce: | awk -F ': ' '{print $2}' | tr -d '\n\r')" | ||
nonce="$(http_request head "${CA_NEW_NONCE}" | grep -i Replay-Nonce: | awk -F ': ' '{print $2}' | tr -d '\n\r')" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lukas2511
Member
|
||
fi | ||
|
||
# Build header with just our public key and algorithm information | ||
|
Why not use only awk here?
nonce="$(http_request head "${CA_NEW_NONCE}" | awk 'BEGIN{ IGNORECASE=1; } /^replay-nonce: / {print $2}')"
return same filed value without grep + tr and multiple forks.