From c6dff0f738ecd7b1d8f7857dbf3b49fb23ee9b29 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 30 Jul 2019 23:27:21 +0800
Subject: [PATCH] Update setup_wiringPi shell script

---
 tools/setup_wiringPi.sh |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/tools/setup_wiringPi.sh b/tools/setup_wiringPi.sh
index 558743e..9dbe3cf 100755
--- a/tools/setup_wiringPi.sh
+++ b/tools/setup_wiringPi.sh
@@ -1,17 +1,30 @@
 #!/bin/bash
 # This shell script used to install wiringPi library
 
-gpio -v > /dev/null 
-if [ $? == 0 ] ; then
-    echo "wiringPi library already installed, exit now..."
-    exit;
-fi
+function install_wiringpi()
+{
+    gpio -v > /dev/null 
+    if [ $? == 0 ] ; then
+        echo "wiringPi library already installed, exit now..."
+        return;
+    fi
 
-if [ ! -d wiringPi ] ; then
-    git clone git://git.drogon.net/wiringPi 
-fi
+    if [ ! -d wiringPi ] ; then
+        git clone git://git.drogon.net/wiringPi 
+    fi
 
-cd wiringPi 
-git pull origin
-./build
+    cd wiringPi 
+    git pull origin
+    ./build
+}
+
+function install_systools()
+{
+    sudo apt-get install -y  libssl-dev openssl
+}
+
+
+install_systools
+
+install_wiringpi
 

--
Gitblit v1.9.1