forked from JamezQ/Palaver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpycmd
executable file
·53 lines (46 loc) · 780 Bytes
/
pycmd
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
#!/bin/bash
# right now it uses moving of files, but we may want to communicate with the
# python script another way.
function error() {
echo "Accepted modes:"
echo "wait"
echo "done"
echo "stop"
echo "record"
echo "result"
}
if [ -z "$1" ];then
error
fi
if ps auxww |grep -v grep |grep osd_server > /dev/null 2>&1;then
: # we are good, the server is there
else # otherwise start it
./Microphone/osd_server.py &
fi
# This should be run from the base dir.
cd Microphone
case "$1" in
wait)
rm pycmd_*
touch pycmd_wait
;;
done)
rm pycmd_*
touch pycmd_done
;;
stop)
rm pycmd_*
touch pycmd_stop
;;
record)
rm pycmd_*
touch pycmd_record
;;
result)
rm pycmd_*
touch pycmd_result
;;
*)
error
;;
esac