-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·41 lines (37 loc) · 1.05 KB
/
install.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
#!/usr/bin/env bash
# Detect operating system
if [ -f /etc/os-release ]; then
# freedesktop.org and systemd
. /etc/os-release
OS=$NAME
VER=$VERSION_ID
elif type lsb_release >/dev/null 2>&1; then
# linuxbase.org
OS=$(lsb_release -si)
VER=$(lsb_release -sr)
elif [ -f /etc/lsb-release ]; then
# For some versions of Debian/Ubuntu without lsb_release command
. /etc/lsb-release
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
# Older Debian/Ubuntu/etc.
OS=Debian
VER=$(cat /etc/debian_version)
else
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
OS=$(uname -s)
VER=$(uname -r)
fi
if [ "$OS" == "Darwin" ]; then
echo "Install for MacOs"
./mac_install.sh
elif [ "$OS" == "Raspbian GNU/Linux" ] | [ "$OS" == "Debian GNU/Linux" ]; then
echo "Install for Debian"
./debian_install.sh
elif [ "$OS" == "Manjaro Linux" ]; then
echo "Install for Arch"
./arch_install.sh
else
echo "ERROR: Operating system could not be determined: $OS"
fi