-
Notifications
You must be signed in to change notification settings - Fork 1
/
gu.sh
42 lines (35 loc) · 1.45 KB
/
gu.sh
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
#!/bin/bash
sudo apt update -q
sudo apt upgrade -y -q
if grep -q 'Raspberry' /proc/device-tree/model; then
hardware=RaspberryPi
elif grep -q 'Tinker' /proc/device-tree/model; then
hardware=Tinkerboard
elif grep -q 'XU4' /proc/device-tree/model; then
hardware=OdroidXU4
elif grep -q 'ODROID-C2' /proc/device-tree/model; then
hardware=OdroidC2
elif grep -q 'Libre' /proc/device-tree/model; then
hardware=LibreLePotato
fi
sudo supervisorctl stop gubiq
if [ $hardware = RaspberryPi ] || [ $hardware = Tinkerboard ] || [ $hardware = OdroidXU4 ]; then
sudo rm gubiq-linux-arm7
sudo rm /usr/bin/gubiq
wget https://github.com/ubiq/go-ubiq/releases/download/v7.0.0/gubiq-linux-arm7
echo "a3e9472a2719b186cd3027d08254c15a362108121e392eba23141fef95ed29ed gubiq-linux-arm7" | sha256sum -c - || exit 1
elif [ $hardware = OdroidC2 ] || [ $hardware = LibreLePotato ]; then
sudo rm gubiq-linux-arm64
sudo rm /usr/bin/gubiq
wget https://github.com/ubiq/go-ubiq/releases/download/v7.0.0/gubiq-linux-arm64
echo "d87c8ee12516e99dfe9a02e877bae7e57c5eb3412d27fb79f33ab2413e35563c gubiq-linux-arm64" | sha256sum -c - || exit 1
fi
if [ $hardware = RaspberryPi ] || [ $hardware = Tinkerboard ] || [ $hardware = OdroidXU4 ]; then
sudo cp ./gubiq-linux-arm7 /usr/bin/gubiq
elif [ $hardware = OdroidC2 ] || [ $hardware = LibreLePotato ]; then
sudo cp ./gubiq-linux-arm64 /usr/bin/gubiq
fi
sudo chmod +x /usr/bin/gubiq
sudo supervisorctl start gubiq
sudo rm $0
sudo reboot