Skip to content

Commit 5ec6575

Browse files
committed
Prevent wd_rtsp.sh from starting multiple times
1 parent 719c90e commit 5ec6575

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/static/static/home/yi-hack/script/service.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ start_rtsp()
132132
fi
133133

134134
$RTSP_DAEMON $RTSP_RES $CODEC_LOW $CODEC_HIGH $RTSP_AUDIO_COMPRESSION $RTSP_PORT $RTSP_USER $RTSP_PASSWORD $NR_LEVEL $B_ONVIF_AUDIO_BC >/dev/null &
135-
(sleep 30; $YI_HACK_PREFIX/script/wd_rtsp.sh >/dev/null) &
135+
136+
WD_COUNT=$(ps | grep wd_rtsp.sh | grep -v grep | grep -c ^)
137+
if [ $WD_COUNT -eq 0 ]; then
138+
(sleep 30; $YI_HACK_PREFIX/script/wd_rtsp.sh >/dev/null) &
139+
fi
136140
}
137141

138142
stop_rtsp()

0 commit comments

Comments
 (0)