mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-30 22:30:36 +03:00
comfunc: Fix remove debug log
This commit is contained in:
@@ -168,7 +168,7 @@ function merge_cfg_with_def_values
|
|||||||
function remove_cron_task_logs
|
function remove_cron_task_logs
|
||||||
{
|
{
|
||||||
if [ -f "$CRONTAB_FILE" ]; then
|
if [ -f "$CRONTAB_FILE" ]; then
|
||||||
sed -i "/-name 'zapret\*.log' -size +/d" "$CRONTAB_FILE"
|
sed -i "/-name 'zapret+\*.log' -size +/d" "$CRONTAB_FILE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ function insert_cron_task_logs
|
|||||||
[ ! -f "$CRONTAB_FILE" ] && touch "$CRONTAB_FILE"
|
[ ! -f "$CRONTAB_FILE" ] && touch "$CRONTAB_FILE"
|
||||||
[ ! -f "$CRONTAB_FILE" ] && return 1
|
[ ! -f "$CRONTAB_FILE" ] && return 1
|
||||||
if ! grep -q -e "-name 'zapret\*\.log' -size \+" "$CRONTAB_FILE"; then
|
if ! grep -q -e "-name 'zapret\*\.log' -size \+" "$CRONTAB_FILE"; then
|
||||||
echo "*/2 * * * * /usr/bin/find /tmp -maxdepth 1 -type f -name 'zapret*.log' -size +2600k -exec rm -f {} \;" >> "$CRONTAB_FILE"
|
echo "*/2 * * * * /usr/bin/find /tmp -maxdepth 1 -type f -name 'zapret+*.log' -size +2600k -exec rm -f {} \;" >> "$CRONTAB_FILE"
|
||||||
/etc/init.d/cron restart 2> /dev/null
|
/etc/init.d/cron restart 2> /dev/null
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
@@ -190,7 +190,7 @@ function init_before_start
|
|||||||
[ ! -f "$HOSTLIST_FN" ] && touch "$HOSTLIST_FN"
|
[ ! -f "$HOSTLIST_FN" ] && touch "$HOSTLIST_FN"
|
||||||
chmod 644 $ZAPRET_BASE/ipset/*.txt
|
chmod 644 $ZAPRET_BASE/ipset/*.txt
|
||||||
chmod 666 $ZAPRET_BASE/ipset/*.log
|
chmod 666 $ZAPRET_BASE/ipset/*.log
|
||||||
rm -f /tmp/zapret*.log
|
rm -f /tmp/zapret+*.log
|
||||||
#*/
|
#*/
|
||||||
if [ "$DAEMON_LOG_ENABLE" = "1" ]; then
|
if [ "$DAEMON_LOG_ENABLE" = "1" ]; then
|
||||||
insert_cron_task_logs
|
insert_cron_task_logs
|
||||||
|
|||||||
Reference in New Issue
Block a user