-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathinstall.sh
executable file
·56 lines (50 loc) · 1.47 KB
/
install.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
#!/bin/bash
DOWNLOADED=false
if [ "$(id -u)" != "0" ]; then
echo "Sorry, you are not root."
exit 1
fi
echo "This script will guide you to install the PythonMiniProbe"
echo "installing python-dev and build-essentials"
apt-get -y install python-dev build-essential 2>&1 >> /tmp/probe_install.log
case "$(python --version 2>&1)" in
*" 2.7.9"*)
echo "Correct python version!"
;;
*" 3."*)
echo "Correct python version!"
;;
*)
echo "Installing PIP!"
apt-get -y install python-pip 2>&1 >> /tmp/probe_install.log
;;
esac
if [ ! -f ./README.md ]
then
read -p "Use git to install the miniprobe (y|n)? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
git clone https://github.com/PaesslerAG/PythonMiniProbe.git /PythonMiniProbe
cd /PythonMiniProbe
DOWNLOADED=true
else
read -p "Use wget to install the miniprobe (y|n)? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
wget -O /tmp/probe.zip https://github.com/PaesslerAG/PythonMiniProbe/archive/master.zip
unzip /tmp/probe.zip -d /tmp
mv /tmp/PythonMiniProbe-master /PythonMiniProbe
cd /PythonMiniProbe
DOWNLOADED=true
fi
fi
else
DOWNLOADED=true
fi
if [ "$DOWNLOADED" = true ]
then
echo "Starting to install the miniprobe and requirements"
python setup.py install
fi