forked from xoseperez/xbee2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
do
executable file
·48 lines (36 loc) · 835 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
#!/bin/bash
set -e
FOLDER=$(dirname $(realpath $0))/.venv
PIP=$FOLDER/bin/pip
PYTHON=$FOLDER/bin/python
if [ $# -eq 0 ]; then
ACTION='activate'
else
ACTION=$1
fi
case "$ACTION" in
"setup")
if [ ! -d $FOLDER ]; then
virtualenv $FOLDER
fi
$PIP install --upgrade ConfigParser
$PIP install --upgrade pyaml
$PIP install --upgrade pyserial
$PIP install --upgrade nose
$PIP install --upgrade paho-mqtt
$PIP install --upgrade parse
$PIP install --upgrade xbee
;;
"start" | "stop" | "restart")
$PYTHON xbee2mqtt.py $ACTION
;;
"tests")
$PYTHON $FOLDER/bin/nosetests --nocapture
;;
"console")
$PYTHON xbee2console.py
;;
*)
echo "Unknown action $ACTION."
;;
esac