mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
fixed LE status check
This commit is contained in:
parent
47bdaeb1f5
commit
dabb19573c
1 changed files with 9 additions and 3 deletions
|
@ -110,7 +110,6 @@ else
|
||||||
$BIN/v-restart-web
|
$BIN/v-restart-web
|
||||||
check_result $? "Web restart failed" >/dev/null
|
check_result $? "Web restart failed" >/dev/null
|
||||||
fi
|
fi
|
||||||
sleep 30
|
|
||||||
|
|
||||||
# Defining ACME query (request validation)
|
# Defining ACME query (request validation)
|
||||||
query='{"resource":"challenge","type":"http-01","keyAuthorization"'
|
query='{"resource":"challenge","type":"http-01","keyAuthorization"'
|
||||||
|
@ -125,11 +124,18 @@ data=$data'"payload":"'"$payload"'","signature":"'"$signature"'"}'
|
||||||
answer=$(curl -s -i -d "$data" "$uri")
|
answer=$(curl -s -i -d "$data" "$uri")
|
||||||
|
|
||||||
# Checking domain validation status
|
# Checking domain validation status
|
||||||
status=$(echo $answer |grep status |cut -f 4 -d \")
|
i=1
|
||||||
|
status=$(echo $answer |tr ',' '\n' |grep status |cut -f 4 -d \")
|
||||||
location=$(echo "$answer" |grep Location: |awk '{print $2}' |tr -d '\r\n')
|
location=$(echo "$answer" |grep Location: |awk '{print $2}' |tr -d '\r\n')
|
||||||
while [ "$status" = 'pending' ] ; do
|
while [ "$status" = 'pending' ]; do
|
||||||
answer=$(curl -s -i "$location")
|
answer=$(curl -s -i "$location")
|
||||||
|
detail="$(echo $answer |tr ',' '\n' |grep detail |cut -f 4 -d \")"
|
||||||
status=$(echo "$answer" |tr ',' '\n' |grep status |cut -f 4 -d \")
|
status=$(echo "$answer" |tr ',' '\n' |grep status |cut -f 4 -d \")
|
||||||
|
sleep 1
|
||||||
|
i=$((i + 1))
|
||||||
|
if [ "$i" -gt 60 ]; then
|
||||||
|
check_result $E_CONNECT "$detail"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
if [ "$status" = 'invalid' ]; then
|
if [ "$status" = 'invalid' ]; then
|
||||||
detail="$(echo $answer |tr ',' '\n' |grep detail |cut -f 4 -d \")"
|
detail="$(echo $answer |tr ',' '\n' |grep detail |cut -f 4 -d \")"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue