Compare commits

...

2 Commits
master ... fix

Author SHA1 Message Date
Florian Schlegel bce84496f7 was auch immer ich damals getan habe... 2021-03-08 21:45:54 +01:00
Florz e767a07ac2 fixed 2014-04-04 20:28:13 +02:00
2 changed files with 17 additions and 6 deletions

14
Dump.sh
View File

@ -2,16 +2,16 @@
while true; do ( while true; do (
NAME=$1 NAME=$1
SERVER_IP=192.168.1.66 #SERVER_IP=192.168.1.66
#SERVER_IP=192.168.1.20 SERVER_IP=192.168.1.20
PORT=8080 PORT=8080
USERNAME=admin USERNAME=admin
PASSWORD="123456" PASSWORD="123456"
CAMERAS="0 1 2 3 4 5 6 7 8 9" CAMERAS="0 1 2 3 4 5 6 7 8 9"
# the real values _will_ differ depending on the machine running the script !!! # the real values _will_ differ depending on the machine running the script !!!
SECONDS_PER_FILE=3600 SECONDS_PER_FILE=10
OVERLAP_PER_FILE=60 OVERLAP_PER_FILE=2
FFMPEG_TIMEOUT=10000000 # 10 seconds FFMPEG_TIMEOUT=1000000 # 1 seconds
PIDFILE_BASE=/tmp/wget_script.$RANDOM.pids PIDFILE_BASE=/tmp/wget_script.$RANDOM.pids
if [ -z "$NAME" ]; then if [ -z "$NAME" ]; then
@ -62,9 +62,11 @@ do_record() {
# THIS_SLEEP_PID="$(cat ${PIDFILE_BASE}_SLEEP_PID_${GROUP_ID})" # THIS_SLEEP_PID="$(cat ${PIDFILE_BASE}_SLEEP_PID_${GROUP_ID})"
# kill -9 $THIS_SLEEP_PID # kill -9 $THIS_SLEEP_PID
# fi # fi
echo "capture for camera $i died, commiting suicide" echo "capture for camera $i died, killing all captures"
kill "$(cat ${PIDFILE_BASE}_KILL_${GROUP_ID} )"
kill $SCRIPT_PID >> /dev/null 2>&1 kill $SCRIPT_PID >> /dev/null 2>&1
sleep 10 sleep 10
kill -9 "$(cat ${PIDFILE_BASE}_KILL_${GROUP_ID} )"
kill -9 %SCRIPT_PID >> /dev/null 2>&1 kill -9 %SCRIPT_PID >> /dev/null 2>&1
fi fi
} }

9
run.sh Executable file
View File

@ -0,0 +1,9 @@
#! /bin/bash
SCRIPT_DIR="$( cd $( dirname "${BASH_SOURCE[0]}" ); pwd )/"
while true; do
pkill -9 Dump.sh
$SCRIPT_DIR/Dump.sh
sleep 10
done