From f8c8fe368bcc8765de5955f31df610856cddf7c1 Mon Sep 17 00:00:00 2001 From: eagle00789 Date: Mon, 1 Jun 2015 12:39:55 +0200 Subject: [PATCH] Added installer which can be user as a single download to download/install the Miniprobe --- install.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..af52dd6 --- /dev/null +++ b/install.sh @@ -0,0 +1,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 >> /dev/null + +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 >> /dev/null + ;; +esac + +if [ ! -f ./README.md ] + 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 + python setup.py configure +fi