Skip to content

Commit

Permalink
Merge pull request #28 from KurisuWong/master
Browse files Browse the repository at this point in the history
fixing bug caused by empty certificate received (updated)
  • Loading branch information
andyzhshg authored Oct 9, 2019
2 parents f6b77f5 + f208100 commit 7d54ac3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cert-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ generateCrt () {
--certpath ${CRT_PATH}/cert.pem \
--key-file ${CRT_PATH}/privkey.pem \
--fullchain-file ${CRT_PATH}/fullchain.pem
echo 'done generateCrt'
return 0

if [ -s "${CRT_PATH}/cert.pem" ]; then
echo 'done generateCrt'
return 0
else
echo '[ERR] fail to generateCrt'
echo "begin revert"
revertCrt $2
exit 1;
fi
}

updateService () {
Expand All @@ -66,6 +74,10 @@ reloadWebService () {
echo 'begin reloadWebService'
echo 'reloading new cert...'
/usr/syno/etc/rc.sysv/nginx.sh reload
echo 'relading Apache 2.2'
stop pkg-apache22
start pkg-apache22
reload pkg-apache22
echo 'done reloadWebService'
}

Expand Down

0 comments on commit 7d54ac3

Please sign in to comment.