1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-03 13:12:44 +02:00

remove pid file for recording even if kill failed (#1132)

There is an issue if the recording process died the stop command will not remove the pid file, and will prevent the start command from being run. 
I copy this code from https://github.com/chaoranxie/Xiaomi-Dafang-Hacks/blob/master/firmware_mod/controlscripts/rtsp-h264#L100
This commit is contained in:
Chao
2019-08-25 21:30:02 -04:00
committed by jmtatsch
parent c388c86330
commit 08aa62bbb7

View File

@@ -40,7 +40,8 @@ stop()
{
pid="$(cat "$PIDFILE" 2>/dev/null)"
if [ "$pid" ]; then
kill "$pid" && rm "$PIDFILE"
kill "$pid"
rm "$PIDFILE" 1> /dev/null 2>&1
echo "Stopped recording."
else
echo "Could not find a running recording to stop."