-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
reinstall
executable file
·44 lines (39 loc) · 1.24 KB
/
reinstall
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
#!/bin/sh
vMaj=`cut -d. -f1 VERSION`
vMin=`cut -d. -f2 VERSION`
WPIVERSION=$vMaj.$vMin
ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
if [ -f /etc/os-release ]; then
# load vars from /etc/os-release
. /etc/os-release
if [ "$ID" = "raspbian" ] || [ "$ID" = "debian" ] || [ "$ID" = "linuxmint" ]; then
if [ "$ID" = "raspbian" ]; then
echo OS: Raspberry Pi OS
else
echo OS: Debian
fi
echo using all in one deb-package
echo ============================
echo
sudo apt -y remove wiringpi
./build clean
./build debian
mv debian-template/wiringpi_${WPIVERSION}_${ARCH}.deb .
sudo apt install ./wiringpi_${WPIVERSION}_${ARCH}.deb
elif [ "$ID" = "debian" ] || [ "$ID" = "linuxmint" ]; then
echo OS: Ubuntu/Mint
echo using 3 deb-package
echo ===================
echo
sudo apt -y remove libwiringpi2
sudo apt -y remove libwiringpi3
sudo apt -y remove wiringpi libwiringpi-dev
./build clean
./build ubuntu
#mv debian-template/wiringpi_${WPIVERSION}_armhf.deb .
#sudo apt install ./wiringpi_${WPIVERSION}_armhf.deb
fi
else
echo OS unknown, exit
exit
fi