From 685afc1a693396467b6b76b2dae13980c4454f97 Mon Sep 17 00:00:00 2001 From: remittor Date: Tue, 13 Jan 2026 21:42:04 +0300 Subject: [PATCH] comfunc: Fix recreating crontab log cleaning task on restart PR: https://github.com/remittor/zapret-openwrt/pull/659/commits/ad6b23f4aa8c5dbabd42e3b70907a2b18cc5149e --- zapret2/comfunc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zapret2/comfunc.sh b/zapret2/comfunc.sh index 73d71b4..c4b51f6 100755 --- a/zapret2/comfunc.sh +++ b/zapret2/comfunc.sh @@ -179,7 +179,7 @@ function insert_cron_task_logs { [ ! -f "$CRONTAB_FILE" ] && touch "$CRONTAB_FILE" [ ! -f "$CRONTAB_FILE" ] && return 1 - if ! grep -q -e "-name '$ZAPRET_CFG_NAME\*\.log' -size \+" "$CRONTAB_FILE"; then + if ! grep -q -e "-name '$ZAPRET_CFG_NAME+\*\.log' -size \+" "$CRONTAB_FILE"; then echo "*/2 * * * * /usr/bin/find /tmp -maxdepth 1 -type f -name '$ZAPRET_CFG_NAME+*.log' -size +2600k -exec rm -f {} \;" >> "$CRONTAB_FILE" /etc/init.d/cron restart 2> /dev/null fi