From fa05fe6bfd8ceab1082249fd7b41fb3a0e6693cd Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 31 Jul 2019 13:06:01 +0800
Subject: [PATCH] update setup_wiringPi shell

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

diff --git a/tools/setup_wiringPi.sh b/tools/setup_wiringPi.sh
index 558743e..12e7d5c 100755
--- a/tools/setup_wiringPi.sh
+++ b/tools/setup_wiringPi.sh
@@ -1,17 +1,36 @@
 #!/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
+        if [ -f WiringPi.tar.bz2 ] ; then
+            echo "## decompress WiringPi libarary packet ##"
+            tar -xjf WiringPi.tar.bz2
+        else 
+            echo "## git clone WiringPi libarary source code ##"
+            git clone https://github.com/WiringPi/WiringPi.git
+        fi
+    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