-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·50 lines (41 loc) · 1.17 KB
/
configure
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
#!/bin/sh
echo Looking for a suitable Python interpreter...
interpreters="pypy jython python"
for interpreter in $interpreters; do
if [ -z "$PYTHON" ]; then
i="`which $interpreter`"
if [ "$i" ]; then
$i -c "import sys; exit(sys.hexversion < 0x2070000 or sys.hexversion >= 0x3000000)"
if [ "$?" -eq "0" ]; then
echo "SUCCESS: Fastest suitable interpreter is $interpreter"
PYTHON=$interpreter
else
echo "WARNING: $interpreter found but wrong version"
fi
else
echo "WARNING: $interpreter not found"
fi
fi
done
if [ -z "$PYTHON" ]; then
echo "ERROR: Require Python 2 ($interpreters), version 2.7 or above"
exit
fi
if [ -z "`which streamer`" ]; then
echo "ERROR: Please install streamer"
exit
else
echo "SUCCESS: Found streamer"
fi
# Find most recently added video device
DEVICE="`ls -1 /dev/video* | tail -1`"
if [ -z $DEVICE ]; then
echo "ERROR: Couldn't find a suitable video4linux device"
exit
else
echo "SUCCESS: Using $DEVICE"
fi
# write config file
echo PYTHON="$PYTHON" > settings.conf
echo DEVICE="$DEVICE" >> settings.conf
echo "SUCCESS: settings.conf written. You can now run ./capture"