Server : nginx/1.20.1 System : Linux ccpf-production-2021 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 User : forge ( 1000) PHP Version : 7.4.21 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/2383124/cwd/.letsencrypt-renew/ |
TIME=$(date +%s)
{
wget -nv -O letsencrypt_script$TIME "https://forge-certificates.laravel.com/le/2783196/1398394/ecdsa?v=2&env=production"
bash letsencrypt_script$TIME
} &> /home/forge/.letsencrypt-renew/2783196.out
STATUS=$([ $? -eq 0 ] && echo "success" || echo "failure")
echo "LetsEncrypt finished with status: $STATUS"
rm letsencrypt_script$TIME
REPORTING_STATUS_CODE=0
REPORTING_ATTEMPTS=1
REPORTING_MAX_ATTEMPTS=5
REPORTING_SLEEP=15
until [ "$REPORTING_STATUS_CODE" -ge 200 ] && [ "$REPORTING_STATUS_CODE" -le 204 ]; do
REPORTING_STATUS_CODE=$(curl --write-out "%{http_code}" --output /dev/null -s -L --request POST \
--url "https://forge.laravel.com/ssl/ping" \
--data-urlencode "site=1398394" \
--data-urlencode "certificate=2783196" \
--data-urlencode "status=$STATUS"
)
if [ "$REPORTING_STATUS_CODE" -ge 200 ] && [ "$REPORTING_STATUS_CODE" -le 204 ]; then
echo "Successfully reported LetsEncrypt request status back to Laravel Forge."
break
fi
if [ $REPORTING_ATTEMPTS -eq $REPORTING_MAX_ATTEMPTS ]; then
echo "Failed to report LetsEncrypt request status back to Laravel Forge after $REPORTING_ATTEMPTS attempts."
exit 1
fi
echo "Failed to report LetsEncrypt request status back to Laravel Forge. Retrying in $REPORTING_SLEEP seconds..."
sleep $REPORTING_SLEEP
REPORTING_ATTEMPTS=$((REPORTING_ATTEMPTS+1))
done