From 03fdf3c1075aed8a44c1acb1106960389dc06eb8 Mon Sep 17 00:00:00 2001 From: Greg <58589583+grzesiczek1@users.noreply.github.com> Date: Sun, 1 Nov 2026 18:26:42 +0100 Subject: [PATCH] wd_rtsp.sh: make the locked rRTSPServer check work check_rtsp() counts sockets with grep ":$RTSP_PORT ", but the script only sets RRTSP_PORT. With the empty variable the pattern is ": ", which matches no netstat line, so SOCKET is always 0 and the "possible locked process" check never runs: a hung rRTSPServer is not restarted. Use RRTSP_PORT and count ESTABLISHED connections instead of LISTEN, as wd.sh in yi-hack-Allwinner-v2 does. The check is meant for "clients are connected but the server uses no CPU"; with LISTEN it would also count an idle server that has no clients. Co-Authored-By: Claude Opus 5.5 --- src/static/static/home/yi-hack-v5/script/wd_rtsp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh b/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh index 1c020ed2..23607de0 100755 --- a/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh +++ b/src/static/static/home/yi-hack-v5/script/wd_rtsp.sh @@ -86,7 +86,7 @@ restart_mqttv4() check_rtsp() { - SOCKET=`/bin/netstat -an 2>&1 | grep ":$RTSP_PORT " | grep LISTEN | grep -c ^` + SOCKET=`/bin/netstat -an 2>&1 | grep ":$RRTSP_PORT " | grep ESTABLISHED | grep -c ^` CPU=`top -b -n 1 | grep rRTSPServer | grep -v grep | tail -n 1 | awk '{print $8}'` if [ "$CPU" == "" ]; then