Skip to content

Commit ab36d7c

Browse files
authoredJul 28, 2021
Merge pull request #65 from HerbertGao/master
解决 DSM 7.0 下脚本无法重启 Nginx 更新证书的问题
2 parents 186137f + 26c123e commit ab36d7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎cert-up.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ ACME_BIN_PATH=${BASE_ROOT}/acme.sh
1212
TEMP_PATH=${BASE_ROOT}/temp
1313
CRT_PATH_NAME=`cat ${CRT_BASE_PATH}/_archive/DEFAULT`
1414
CRT_PATH=${CRT_BASE_PATH}/_archive/${CRT_PATH_NAME}
15+
FIND_MAJORVERSION_FILE="/etc/VERSION"
16+
FIND_MAJORVERSION_STR="majorversion=\"7\""
1517

1618
backupCrt () {
1719
echo 'begin backupCrt'
@@ -75,7 +77,13 @@ updateService () {
7577
reloadWebService () {
7678
echo 'begin reloadWebService'
7779
echo 'reloading new cert...'
78-
/usr/syno/etc/rc.sysv/nginx.sh reload
80+
if [ `grep -c "$FIND_MAJORVERSION_STR" $FIND_MAJORVERSION_FILE` -ne '0' ];then
81+
echo "MajorVersion = 7"
82+
synosystemctl restart nginx
83+
else
84+
echo "MajorVersion < 7"
85+
/usr/syno/etc/rc.sysv/nginx.sh reload
86+
fi
7987
echo 'relading Apache 2.2'
8088
stop pkg-apache22
8189
start pkg-apache22

0 commit comments

Comments
 (0)
Please sign in to comment.