forked from ehendrix23/tesla_dashcam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunPreferences.bash
executable file
·62 lines (48 loc) · 1.56 KB
/
RunPreferences.bash
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Small script that will run tesla_dashcam leveraging all the different preferences provided in the Preference_Files folder.
# Folder(s) to scan for clips
InputFolders='/Volumes/TeslaCam/TeslaCam/SentryClips /Volumes/TeslaCam/TeslaCam/SavedClips'
# Folder to store resulting movie files.
OutputFolder='/Volumes/TeslaCam/Movies'
# Start Timestamp
StartTimestamp=""
# StartTimestamp="2020-09-19T13:29:10"
# End Timestamp
EndTimestamp=""
# EndTimestamp="2020-09-19T13:29:30"
# Path to folder containing the preference files
PreferenceFolder="./Preference_Files"
# LogLevel
LogLevel=""
# LogLevel="DEBUG"
if [ -f tesla_dashcam/tesla_dashcam.py ]; then
Command="tesla_dashcam/tesla_dashcam.py"
else
Command="tesla_dashcam.py"
fi
Command="python ${Command}"
if [ "${OutputFolder}" != "" ]; then
if [ ! -d ${OutputFolder} ]; then
mkdir ${OutputFolder}
fi
OutputFolder="--output ""${OutputFolder}"""
fi
if [ "${StartTimestamp}" != "" ]; then
StartTimestamp="--start_timestamp ${StartTimestamp}"
fi
if [ "${EndTimestamp}" != "" ]; then
EndTimestamp="--end_timestamp ${EndTimestamp}"
fi
if [ "${LogLevel}" != "" ]; then
LogLevel="--loglevel ${LogLevel}"
fi
for preferencefile in ${PreferenceFolder}/*; do
filename="${preferencefile##*/}"
folder=${filename%%.*}
echo "Using Preference File ${filename}"
echo "${Command} ${InputFolders} ${LogLevel} ${OutputFolder} @${preferencefile} ${StartTimestamp} ${EndTimestamp}"
${Command} ${InputFolders} ${LogLevel} ${OutputFolder} @${preferencefile} ${StartTimestamp} ${EndTimestamp}
if [ $? -ne 0 ]; then
exit 1
fi
done