fix: generate share links before acme reloadcmd registration
Avoid script exit when acme reloadcmd fails transiently on systemd dbus. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,11 +65,6 @@ systemctl daemon-reload
|
|||||||
systemctl enable sing-box
|
systemctl enable sing-box
|
||||||
systemctl restart sing-box
|
systemctl restart sing-box
|
||||||
|
|
||||||
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
|
|
||||||
--key-file /etc/sing-box/certs/privkey.pem \
|
|
||||||
--fullchain-file /etc/sing-box/certs/fullchain.pem \
|
|
||||||
--reloadcmd "systemctl restart sing-box"
|
|
||||||
|
|
||||||
CLIENT_DIR="${ROOT_DIR}/client/generated"
|
CLIENT_DIR="${ROOT_DIR}/client/generated"
|
||||||
mkdir -p "$CLIENT_DIR"
|
mkdir -p "$CLIENT_DIR"
|
||||||
sed -e "s|\${VPS_IP}|${VPS_IP}|g" \
|
sed -e "s|\${VPS_IP}|${VPS_IP}|g" \
|
||||||
@@ -89,6 +84,12 @@ vless://${UUID}@${VPS_IP}:443?encryption=none&flow=xtls-rprx-vision&security=rea
|
|||||||
hy2://${HY2_PASSWORD}@${DOMAIN}:8443?sni=${DOMAIN}#Hysteria2-Backup
|
hy2://${HY2_PASSWORD}@${DOMAIN}:8443?sni=${DOMAIN}#Hysteria2-Backup
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
|
||||||
|
--key-file /etc/sing-box/certs/privkey.pem \
|
||||||
|
--fullchain-file /etc/sing-box/certs/fullchain.pem \
|
||||||
|
--reloadcmd "systemctl restart sing-box" \
|
||||||
|
|| echo "警告: acme reloadcmd 注册失败,sing-box 已在运行,可忽略"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "完成!sing-box 状态:"
|
echo "完成!sing-box 状态:"
|
||||||
systemctl status sing-box --no-pager
|
systemctl status sing-box --no-pager
|
||||||
|
|||||||
+2
-1
@@ -143,7 +143,8 @@ log "注册证书续期 reload 命令 ..."
|
|||||||
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
|
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
|
||||||
--key-file /etc/sing-box/certs/privkey.pem \
|
--key-file /etc/sing-box/certs/privkey.pem \
|
||||||
--fullchain-file /etc/sing-box/certs/fullchain.pem \
|
--fullchain-file /etc/sing-box/certs/fullchain.pem \
|
||||||
--reloadcmd "systemctl restart sing-box"
|
--reloadcmd "systemctl restart sing-box" \
|
||||||
|
|| log "acme reloadcmd 注册失败,可忽略(服务已配置)"
|
||||||
|
|
||||||
systemctl restart sing-box
|
systemctl restart sing-box
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user