init: Remove logs on start and restart

This commit is contained in:
remittor
2025-02-09 20:55:44 +03:00
parent adab5d93c5
commit f7114167eb
2 changed files with 7 additions and 1 deletions

View File

@@ -71,3 +71,8 @@ function boot
/bin/sh /etc/rc.common $ZAPRET_ORIG_INITD start "$@"
}
function restart
{
rm -f /tmp/zapret*.log
/bin/sh /etc/rc.common $ZAPRET_ORIG_INITD restart "$@"
}

View File

@@ -29,7 +29,7 @@ diff --git a/init.d/openwrt/zapret b/init.d/openwrt/zapret
index 8d6d3a9..fcb1e91 100755
--- a/init.d/openwrt/zapret
+++ b/init.d/openwrt/zapret
@@ -58,12 +58,26 @@ run_daemon()
@@ -58,12 +58,27 @@ run_daemon()
# use $PIDDIR/$DAEMONBASE$1.pid as pidfile
local DAEMONBASE="$(basename "$2")"
echo "Starting daemon $1: $2 $3"
@@ -43,6 +43,7 @@ index 8d6d3a9..fcb1e91 100755
+ DAEMON_LOG=${DAEMON_LOG/<DAEMON_NAME>/$DAEMON_NAME}
+ DAEMON_LOG=${DAEMON_LOG/<DAEMON_IDNUM>/$DAEMON_IDNUM}
+ DAEMON_LOG=${DAEMON_LOG/<DAEMON_CFGNAME>/$DAEMON_CFGNAME}
+ [ -f "$DAEMON_LOG" ] && rm -f "$DAEMON_LOG"
+ DAEMON_ARGS="--debug=@$DAEMON_LOG $DAEMON_ARGS"
+ fi
procd_open_instance