-
Notifications
You must be signed in to change notification settings - Fork 156
/
pycmd
executable file
·60 lines (53 loc) · 1.02 KB
/
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
53
54
55
56
57
58
59
#!/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 2>/dev/null &
echo $! > "osd.pid"
fi
if ps auxww |grep -v grep |grep indicator_server.py > /dev/null 2>&1;then
: # we are good, the server is there
else # otherwise start it
./Microphone/indicator_server.py 2>/dev/null &
echo $! > "indicator.pid"
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