guowenxue
2019-08-03 2f6051f61e62ac477622f02708cb8eb13bc0ca51
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
#!/bin/bash
# This shell script used to install wiringPi library
 
function install_wiringpi()
{
    gpio -v > /dev/null 
    if [ $? == 0 ] ; then
        echo "wiringPi library already installed, exit now..."
        #return;
    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
}
 
function install_systools()
{
    sudo apt-get install -y  libssl-dev openssl
}
 
 
#install_systools
 
install_wiringpi