-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-depends.sh
executable file
·111 lines (104 loc) · 2.98 KB
/
install-depends.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
#ENV VARS
OS=$(uname)
OS_VERSION=$(uname -r)
UNAME_M=$(uname -m)
ARCH=$(uname -m)
export OS
export OS_VERSION
export UNAME_M
export ARCH
report() {
echo OS:
echo "$OS" | awk '{print tolower($0)}'
echo OS_VERSION:
echo "$OS_VERSION" | awk '{print tolower($0)}'
echo UNAME_M:
echo "$UNAME_M" | awk '{print tolower($0)}'
echo ARCH:
echo "$ARCH" | awk '{print tolower($0)}'
echo OSTYPE:
echo "$OSTYPE" | awk '{print tolower($0)}'
}
checkbrew() {
if hash brew 2>/dev/null; then
brew install awk git
brew install --cask keybase
brew install python@3
$(PYTHON3) -m pip install -r requirements.txt
brew install sphinx-doc
brew link --force sphinx-doc
echo
brew install tccutil
curl -k -o /usr/local/bin/dockutil https://raw.githubusercontent.com/kcrawford/dockutil/master/scripts/dockutil
chmod a+x /usr/local/bin/dockutil
dockutil --add '/Applications/Keybase.app' --replacing 'Keybase'
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
checkbrew
fi
}
checkraspi(){
echo 'Checking Raspi'
if [ -e /etc/rpi-issue ]; then
echo "- Original Installation"
cat /etc/rpi-issue
fi
if [ -e /usr/bin/lsb_release ]; then
echo "- Current OS"
lsb_release -irdc
fi
echo "- Kernel"
uname -r
echo "- Model"
cat /proc/device-tree/model && echo
echo "- hostname"
hostname
echo "- Firmware"
/opt/vc/bin/vcgencmd version
}
if [[ "$OSTYPE" == "linux"* ]]; then
#CHECK APT
if [[ "$OSTYPE" == "linux-gnu" ]]; then
if hash apt 2>/dev/null; then
apt install awk
report
echo 'Using apt...'
curl --remote-name https://prerelease.keybase.io/keybase_amd64.deb
sudo apt install ./keybase_amd64.deb
run_keybase
sudo apt install libappindicator1 libdbusmenu-gtk4 libindicator7 indicator-application #python-setuptools #keybase
$(PYTHON3) -m pip install -r requirements.txt
fi
fi
if [[ "$OSTYPE" == "linux-musl" ]]; then
if hash apk 2>/dev/null; then
apk add awk
report
echo 'Using apk...'
apk add keybase-client
fi
fi
if [[ "$OSTYPE" == "linux-arm"* ]]; then
checkraspi
if hash apt 2>/dev/null; then
apt install awk
report
echo 'Using apt...'
echo https://lekstu.ga/posts/keybase-rpi/
fi
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
$(PYTHON3) -m pip install -r requirements.txt
checkbrew
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo TODO add support for $OSTYPE
elif [[ "$OSTYPE" == "msys" ]]; then
echo TODO add support for $OSTYPE
elif [[ "$OSTYPE" == "win32" ]]; then
echo TODO add support for $OSTYPE
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo TODO add support for $OSTYPE
else
echo TODO add support for $OSTYPE
fi