Abfrage ob ausgabedatei wirklich existiert (vor dem Umbenennen)

This commit is contained in:
root 2012-03-29 16:29:39 +02:00
parent 22dc449836
commit 15ac52543b
1 changed files with 3 additions and 3 deletions

View File

@ -38,9 +38,9 @@ do_record() {
EXACT_START_TIME=$(date +%s.%N)
outfile_close_trap() {
EXACT_END_TIME=$(date +%s.%N)
touch $OUTFILE_START
mv $OUTFILE_START dump_cam_${i}_${EXACT_START_TIME}_${EXACT_END_TIME}.mjpg
echo trapped
if [ -f $OUTFILE_START ]; then
mv $OUTFILE_START dump_cam_${i}_${EXACT_START_TIME}_${EXACT_END_TIME}.mjpg
fi
}
trap outfile_close_trap SIGINT SIGTERM EXIT
wget --ignore-length --http-user=$USERNAME --http-passwd=$PASSWORD http://${SERVER_IP}:$PORT/cam/$i/stream.mjpeg -O $OUTFILE_START -q 2>&1 >> /dev/null