-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdo
executable file
·60 lines (45 loc) · 1.06 KB
/
do
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
#!/bin/bash
FOLDER=.venv
if [ $# -eq 0 ]; then
ACTION='activate'
else
ACTION=$1
fi
case "$ACTION" in
"activate")
. venv/bin/activate
;;
"deactivate")
deactivate
;;
"setup")
if [ ! -d $FOLDER ]; then
virtualenv $FOLDER
fi
deactivate
source $FOLDER/bin/activate
pip install ConfigParser
pip install pyaml
pip install pyserial
pip install nose
wget https://bitbucket.org/oojah/mosquitto/raw/v1.3/lib/python/mosquitto.py
mv mosquitto.py $FOLDER/lib/python2.7/site-packages/
hg clone https://[email protected]/r/xoseperez-python-xbee tmp
cd tmp
python setup.py install
cd ..
rm -rf tmp
;;
"start" | "stop" | "restart")
source $FOLDER/bin/activate
python xbee2mqtt.py $ACTION
deactivate
;;
"tests")
source $FOLDER/bin/activate
.venv/bin/nosetests
;;
*)
echo "Unknown action $ACTION."
;;
esac