@@ -1136,10 +1136,36 @@ ssl_cert_issue() {
1136
1136
LOGE " Issuing certificate succeeded, installing certificates..."
1137
1137
fi
1138
1138
1139
+ reloadCmd=" x-ui restart"
1140
+
1141
+ LOGI " Default --reloadcmd for ACME is: ${yellow} x-ui restart"
1142
+ LOGI " This command will run on every certificate issue and renew."
1143
+ read -p " Would you like to modify --reloadcmd for ACME? (y/n): " setReloadcmd
1144
+ if [[ " $setReloadcmd " == " y" || " $setReloadcmd " == " Y" ]]; then
1145
+ echo -e " \n${green} \t1.${plain} Preset: systemctl reload nginx ; x-ui restart"
1146
+ echo -e " ${green} \t2.${plain} Input your own command"
1147
+ echo -e " ${green} \t0.${plain} Keep default reloadcmd"
1148
+ read -p " Choose an option: " choice
1149
+ case " $choice " in
1150
+ 1)
1151
+ LOGI " Reloadcmd is: systemctl reload nginx ; x-ui restart"
1152
+ reloadCmd=" systemctl reload nginx ; x-ui restart"
1153
+ ;;
1154
+ 2)
1155
+ LOGD " It's recommended to put x-ui restart at the end, so it won't raise an error if other services fails"
1156
+ read -p " Please enter your reloadcmd (example: systemctl reload nginx ; x-ui restart): " reloadCmd
1157
+ LOGI " Your reloadcmd is: ${reloadCmd} "
1158
+ ;;
1159
+ * )
1160
+ LOGI " Keep default reloadcmd"
1161
+ ;;
1162
+ esac
1163
+ fi
1164
+
1139
1165
# install the certificate
1140
1166
~ /.acme.sh/acme.sh --installcert -d ${domain} \
1141
1167
--key-file /root/cert/${domain} /privkey.pem \
1142
- --fullchain-file /root/cert/${domain} /fullchain.pem
1168
+ --fullchain-file /root/cert/${domain} /fullchain.pem --reloadcmd " ${reloadCmd} "
1143
1169
1144
1170
if [ $? -ne 0 ]; then
1145
1171
LOGE " Installing certificate failed, exiting."
@@ -1261,17 +1287,18 @@ ssl_cert_issue_CF() {
1261
1287
LOGI " This command will run on every certificate issue and renew."
1262
1288
read -p " Would you like to modify --reloadcmd for ACME? (y/n): " setReloadcmd
1263
1289
if [[ " $setReloadcmd " == " y" || " $setReloadcmd " == " Y" ]]; then
1264
- echo -e " \n${green} \t1.${plain} Preset: x-ui restart ; systemctl reload nginx"
1290
+ echo -e " \n${green} \t1.${plain} Preset: systemctl reload nginx ; x-ui restart "
1265
1291
echo -e " ${green} \t2.${plain} Input your own command"
1266
1292
echo -e " ${green} \t0.${plain} Keep default reloadcmd"
1267
1293
read -p " Choose an option: " choice
1268
1294
case " $choice " in
1269
1295
1)
1270
- LOGI " Reloadcmd is: x-ui restart ; systemctl reload nginx"
1271
- reloadCmd=" x-ui restart ; systemctl reload nginx"
1296
+ LOGI " Reloadcmd is: systemctl reload nginx ; x-ui restart "
1297
+ reloadCmd=" systemctl reload nginx ; x-ui restart "
1272
1298
;;
1273
- 2)
1274
- read -p " Please enter your reloadcmd (example: x-ui restart ; systemctl reload nginx): " reloadCmd
1299
+ 2)
1300
+ LOGD " It's recommended to put x-ui restart at the end, so it won't raise an error if other services fails"
1301
+ read -p " Please enter your reloadcmd (example: systemctl reload nginx ; x-ui restart): " reloadCmd
1275
1302
LOGI " Your reloadcmd is: ${reloadCmd} "
1276
1303
;;
1277
1304
* )
@@ -1282,6 +1309,7 @@ ssl_cert_issue_CF() {
1282
1309
~ /.acme.sh/acme.sh --installcert -d ${CF_Domain} -d * .${CF_Domain} \
1283
1310
--key-file ${certPath} /privkey.pem \
1284
1311
--fullchain-file ${certPath} /fullchain.pem --reloadcmd " ${reloadCmd} "
1312
+
1285
1313
if [ $? -ne 0 ]; then
1286
1314
LOGE " Certificate installation failed, script exiting..."
1287
1315
exit 1
0 commit comments