mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2025-12-06 03:26:49 +03:00
init: Remove logs on start and restart
This commit is contained in:
@@ -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 "$@"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user