-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop.sh
More file actions
37 lines (34 loc) · 720 Bytes
/
loop.sh
File metadata and controls
37 lines (34 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
PROJECT_DIR=$(readlink -f $(dirname $0))
cd $(dirname $0)
# . /opt/intel/openvino/bin/setupvars.sh
. /home/vvf/coding/cv-env/bin/activate
if [ -z "$1" ]
then
python $PROJECT_DIR/license_ocr.py >> license_ocr.log 2>?1 &
OCR_PID=$!
fi
while true
do
echo ""
if [ -z "$1" ]
then
$PROJECT_DIR/watcher.py 2>> errors.log
else
$1 2>>errors_$2.log
fi
date >> errors.log
echo ""
echo restart @ $(date)
rm current?_*.mp4
if [ -z "$1" ]
then
if kill -0 $OCR_PID 2>/dev/null
then
echo "OCR already worked, PID=$OCR_PID"
else
python $PROJECT_DIR/license_ocr.py >> license_ocr.log &
OCR_PID=$!
fi
fi
done