-
Notifications
You must be signed in to change notification settings - Fork 3
/
do
executable file
·52 lines (40 loc) · 991 Bytes
/
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
#!/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 mosquitto
pip install requests
wget https://bitbucket.org/oojah/mosquitto/raw/v1.3/lib/python/mosquitto.py
mv mosquitto.py $FOLDER/lib/python2.7/site-packages/
;;
"start" | "stop" | "restart")
source $FOLDER/bin/activate
python mqtt2xively.py $ACTION
#python mqtt2tempodb.py $ACTION
python mqtt2thingspeak.py $ACTION
#python mqtt2sense.py $ACTION
python mqtt2thethingsio.py $ACTION
deactivate
;;
*)
echo "Unknown action $ACTION."
;;
esac