소스 검색

better dhparam logging

tags/v1.3.3
Jonathan Cobb 3 년 전
부모
커밋
93951fe57b
1개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. +4
    -5
      bubble-server/src/main/resources/packer/roles/nginx/files/init_dhparams.sh

+ 4
- 5
bubble-server/src/main/resources/packer/roles/nginx/files/init_dhparams.sh 파일 보기

@@ -37,11 +37,10 @@ while [[ $(expr $(date +%s) - ${start}) -le ${TIMEOUT} ]] ; do
log "END-RUNNING-COMPLETED"

HEADER_COUNT=$(grep -c "BEGIN DH PARAMETERS" ${DH_PARAMS})
if [[ ${rval} -eq 0 && -s ${DH_PARAMS} && ${HEADER_COUNT} -gt 0 ]] ; then
if [[ ${rval} -eq 0 && -s ${DH_PARAMS} && $(cat ${DH_PARAMS} | tr -d '\n' | tr -d '[[:blank:]]' | wc -c) -gt 100 && ${HEADER_COUNT} -gt 0 ]] ; then
log "BEGIN-SUCCESS: created ${DH_PARAMS}: "
cat ${DH_PARAMS} >> ${LOG}
log "END-SUCCESS"
exit 0
log "END-SUCCESS (will recheck)"
fi

if [[ ${rval} -ne 0 ]] ; then
@@ -49,8 +48,8 @@ while [[ $(expr $(date +%s) - ${start}) -le ${TIMEOUT} ]] ; do
cat ${DH_PARAMS} >> ${LOG}
log "END-ERROR"

elif [[ ! -s ${DH_PARAMS} ]] ; then
log "BEGIN-ERROR: command 'openssl dhparam -out ${DH_PARAMS} 2048' returned ${rval} and produced empty file, retrying. dhparams="
elif [[ ! -s ${DH_PARAMS} || $(cat ${DH_PARAMS} | tr -d '\n' | tr -d '[[:blank:]]' | wc -c) -le 100 ]] ; then
log "BEGIN-ERROR: command 'openssl dhparam -out ${DH_PARAMS} 2048' returned ${rval} and produced empty (or short) file, retrying. dhparams="
cat ${DH_PARAMS} >> ${LOG}
log "END-ERROR"



불러오는 중...
취소
저장