-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrpaw
executable file
·46 lines (39 loc) · 781 Bytes
/
rpaw
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
#!/usr/bin/env bash
#
# ^ Normally I hate writing a bash script and not a vanilla /bin/sh but
# since this is for the RPi I think it's a reasonable assumption that bash
# is available.
killprocs ()
{
logger -i rpaw "Killing existing RPAW processes"
killall -q omxplayer omxplayer.bin rpaw-wrapper
}
if [ "$1" == "stop" ]
then
killprocs
exit 0
fi
if [ ! -r /dev/vchiq ]
then
echo "Unable to read /dev/vchiq, possible permissions issue."
exit 1
fi
for f in /usr/local/etc/rpaw.conf /etc/rpaw.conf ./rpaw.conf
do
if [ -f $f ]
then
source $f
fi
done
killprocs
sleep 2
for i in {1..16}
do
varname=CAMERA$i
params=${!varname}
if [ "$params" != "" ]
then
logger -i rpaw "Launching camera $i with $params"
eval nohup /usr/sbin/rpaw-wrapper $params &
fi
done