From 1249ee7da2b23066a07425657acbaa66a1ef4f75 Mon Sep 17 00:00:00 2001 From: wikiboss Date: Sat, 12 Sep 2026 16:58:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E7=BD=B2=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20sudo=20=E6=8F=90=E6=9D=83=E5=B9=B3?= =?UTF-8?q?=E6=BB=91=E9=87=8D=E8=BD=BD=20PHP-FPM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deploy.sh b/deploy.sh index fa80665..340d093 100644 --- a/deploy.sh +++ b/deploy.sh @@ -43,8 +43,11 @@ chmod -R 775 public/uploads 2>/dev/null || true # 平滑重载 PHP-FPM 刷新 OPcache 字节码缓存 if [ -x "/etc/init.d/php-fpm-73" ]; then - echo "[${DATE}] 平滑重载 PHP-FPM 7.3..." >> "${LOG_FILE}" - /etc/init.d/php-fpm-73 reload >> "${LOG_FILE}" 2>&1 || true + if command -v sudo >/dev/null 2>&1; then + sudo /etc/init.d/php-fpm-73 reload >> "${LOG_FILE}" 2>&1 || true + else + /etc/init.d/php-fpm-73 reload >> "${LOG_FILE}" 2>&1 || true + fi fi COMMIT_INFO=$(git log -1 --pretty=format:"%h - %s (%an, %cd)")