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:
@@ -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."
|
||||
|
Reference in New Issue
Block a user