From b1a8eb1c9573f285c33ef9226d9a84de9ab1419a Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 20 Aug 2026 08:40:49 +0800 Subject: [PATCH] installcronjob: match the stale cron path without grep -F --- acme.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/acme.sh b/acme.sh index 5a8edab6..20a12992 100755 --- a/acme.sh +++ b/acme.sh @@ -7081,9 +7081,19 @@ _filter_cron_bin() { cat return fi - #-F: binpath is a literal, not a regex (the dot of ~/.acme.sh would - #otherwise match any character) - grep -v -F "$_fcb_bin --cron" + #a case pattern with a quoted variable matches binpath literally, which + #grep cannot do portably: Solaris /usr/bin/grep has no -F, and as a regex + #the dot of ~/.acme.sh would stand for any character + while IFS= read -r _fcb_line || [ -n "$_fcb_line" ]; do + case "$_fcb_line" in + *"$_fcb_bin --cron"*) + _debug3 "Dropping cron entry" "$_fcb_line" + ;; + *) + echo "$_fcb_line" + ;; + esac + done } #confighome