-
Notifications
You must be signed in to change notification settings - Fork 37
/
utils.sh
37 lines (34 loc) · 896 Bytes
/
utils.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
#!/bin/sh
# Set OS, VERSION and ARCH
OS="unknown"
VERSION="unknown"
ARCH="unknown"
ARCHFAMILY="unknown"
if [[ $(cat /etc/os-release) = *"Ubuntu"* ]]; then
OS="ubuntu"
VERSION=`cat /etc/os-release | sed -n 's/VERSION_ID=\"\([0-9].*\)\"/\1/p'`
elif [[ $(cat /etc/os-release) = *"Raspbian"* ]]; then
OS="raspbian"
if [[ $(cat /etc/os-release) = *"stretch"* ]]; then
VERSION="stretch"
elif [[ $(cat /etc/os-release) = *"buster"* ]]; then
VERSION="buster"
fi
elif [[ $(cat /etc/os-release) = *"stretch"* ]]; then
OS="debian"
VERSION="stretch"
elif [[ $(cat /etc/os-release) = *"buster"* ]]; then
OS="debian"
VERSION="buster"
fi
case `uname -m` in
aarch64)
ARCH="aarch64"
ARCHFAMILY="aarch64";;
armv6*)
ARCH="armv6"
ARCHFAMILY="aarch32";;
*)
ARCH="armv7"
ARCHFAMILY="aarch32";;
esac