-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_mbeddr.sh
executable file
·75 lines (53 loc) · 1.25 KB
/
install_mbeddr.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# ! RIGHT CLICK THE LINK AND SELECT "SAVE AS" !
# ! Alternatively, select File Menu->"Save As" !
UNAME=`uname`
BRANCH=master
SCRIPTNAME=$0
if [ $# = 1 ]; then
if [ $1 = latest ]; then
BRANCH=cuttingedge
else
echo "Usage: $SCRIPTNAME [latest]"
echo " latest - install mbeddr from the master branch, otherwise from fortiss_stable branch "
exit 2
fi
fi
URL="https://github.com/qutorial/mbeddr_python_installer/raw/"$BRANCH"/mbeddr_install.py"
PYTHON=""
arr="python3.4
python3
python3.3
python3.2"
for py in $arr
do
PYTHON=`which $py`
if [ "$?" -eq 0 ]; then
break;
fi
done
PYTHON=`which $PYTHON`
if [ "$?" -ne 0 ]; then
echo "Please, install Python 3. Find more instructions here:"
echo "http://mbeddr.fortiss.org/download/prereq/"
exit 1
fi
echo "Using Python at: $PYTHON"
if [ "${UNAME}" = "Linux" ]; then
mi=`mktemp` && wget --no-cache -q $URL -O $mi && $PYTHON $mi;
res=$?;
rm $mi;
exit $res;
fi
if [[ "${UNAME}" == CYGWIN* ]]; then
mi=`mktemp` && wget --no-cache -q $URL -O $mi && $PYTHON $mi;
res=$?;
rm $mi;
exit $res;
fi
if [ "${UNAME}" = "Darwin" ]; then
mi=`mktemp /tmp/mbeddr_install.py.XXXXX` && curl -L $URL -o $mi && $PYTHON $mi;
res=$?;
rm $mi;
exit $res;
fi