-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·376 lines (363 loc) · 7.92 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
#!/usr/bin/env bash
log_txt() {
BLUE="\e[33m"
GREEN="\e[32m"
GREEN="\e[95m"
RED="\e[31m"
YELLOW="\e[34m"
OK="\e[1;32m"
A="\e[3;44m"
ERROR="\e[5;31m"
WARN="\e[1;95m"
WARNLIST="\e[1;95m"
ENDCOLOR="\e[0m"
case $1 in
a)
echo -e "${ENDCOLOR}${A}- ${2}${ENDCOLOR}"
;;
aok)
echo -e "${ENDCOLOR}${OK} ${2} done.${ENDCOLOR}"
;;
aerr)
echo -e "${ENDCOLOR}${ERROR} Err. at ${2}${ENDCOLOR}"
exit 2
;;
b)
echo -e "${ENDCOLOR} - ${2}${ENDCOLOR}"
;;
warn)
echo -e "${ENDCOLOR}${WARN} ${2}${ENDCOLOR}"
;;
warnlista)
echo -e "${ENDCOLOR}${WARNLIST} - ${2}${ENDCOLOR}"
;;
warnlistb)
echo -e "${ENDCOLOR}${WARNLIST} - ${2}${ENDCOLOR}"
;;
*)
echo "${2}"
;;
esac
}
create_dirs() {
FUNC="Creating directories"
log_txt a "$FUNC"
mkdir -p ~/Software/Dev && \
mkdir -p ~/Software/Work && \
mkdir -p ~/.ssh && \
mkdir -p ~/.aws && \
mkdir -p ~/.kube
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
}
apt_install() {
FUNC="Installing stuff through Apt"
log_txt a "$FUNC"
sudo apt-get update && \
sudo apt-get upgrade && \
sudo apt-get install -y \
apt-transport-https \
arp-scan \
bat \
chromium-browser \
cryfs \
curl \
exa \
exfat-fuse \
exfat-utils \
expect \
fabric \
gimp \
git \
gnupg2 \
htop \
inkscape \
iotop \
jq \
keepassx \
mtr \
net-tools \
nmap \
openssh-client \
passwd \
pcsxr \
pwgen \
supertuxkart \
tcptraceroute \
terminator \
unzip \
vim \
vim-gtk \
vlc \
wine \
xsel \
xterm \
zip \
zsh
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
}
install_scripts() {
############################
# OhMyZsh
FUNC="Installing OH My ZSH"
log_txt a "$FUNC"
./scripts/ohmyzsh.sh
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Rust
# TODO: dont do this if rust is
FUNC="Installing Rust"
log_txt a "$FUNC"
which rustc > /dev/null
if [ $? != 0 ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
else
log_txt aok "$FUNC"
fi
############################
# Python
FUNC="Installing Python"
log_txt a "$FUNC"
./scripts/python.sh
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Firefox Dev Edition
FUNC="Installing Firefox Developer Edition"
log_txt a "$FUNC"
./scripts/firefox.sh
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Etcher
FUNC="Installing Etcher"
log_txt a "$FUNC"
./scripts/etcher.sh
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Arduino IDE
FUNC="Installing Arduino IDE"
log_txt a "$FUNC"
sudo snap install arduino && \
sudo usermod -a -G dialout $USER
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Docker
FUNC="Installing Docker"
log_txt a "$FUNC"
sudo snap install docker && \
if [ $(getent group docker) ]; then
echo "group docker exists."
else
sudo groupadd docker
fi && \
sudo usermod -aG docker $USER
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Wine -> Trackmania
FUNC="Installing Wine with trackmania Nations Forever"
log_txt a "$FUNC"
sudo snap install tmnationsforever
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# Node + React
FUNC="Installing NodeJS and React"
log_txt a "$FUNC"
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - && \
sudo apt-get install nodejs -y && \
sudo npm install npm@latest -g && \
sudo npm install -g create-react-app
if [ $? != 0 ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
############################
# # Rambox
# FUNC="Installing Rambox"
# log_txt a "$FUNC"
# sudo snap install rambox
# if [ $? != 0 ]; then
# log_txt aerr "$FUNC"
# else
# log_txt aok "$FUNC"
# fi
############################
# # MicroK8s
# FUNC="Installing MicroK8s"
# log_txt a "$FUNC"
# sudo snap install microk8s --classic
# if [ $? != 0 ]; then
# log_txt aerr "$FUNC"
# else
# log_txt aok "$FUNC"
# fi
############################
# # Dropbox
# FUNC="Installing Dropbox"
# log_txt a "$FUNC"
# ./scripts/dropbox.sh
# if [ $? != 0 ]; then
# log_txt aerr "$FUNC"
# else
# log_txt aok "$FUNC"
# fi
############################
## Lunar Vim
#FUNC="Installing Lunar Vim"
#log_txt a "$FUNC"
#sudo add-apt-repository ppa:neovim-ppa/stable
#sudo apt-get update
#sudo apt-get install neovim
#bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)
#if [ $? != 0 ]; then
# log_txt aerr "$FUNC"
#else
# log_txt aok "$FUNC"
#fi
####
# Steam
# Golang
# Virtualbox
# VPN
# Saml2aws
# awscli
## curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
## unzip awscliv2.zip
## sudo ./aws/install
# terraform
# kubectl
}
latest_considerations() {
log_txt warn "REMEMBER TO NOW DO THE FOLLOWING:"
log_txt warnlista "SSH Keys, GPG, credentials..."
log_txt warnlistb "Copy them over from your backups"
log_txt warnlista "Firefox"
log_txt warnlistb "Import your GPG Keys to Mailvelope"
log_txt warnlista "Gnome"
log_txt warnlistb "Set CTRL-ALT-W to open Webbrowser"
log_txt warnlistb "Set CTRL-ALT-F to open File browser"
log_txt warnlista ".zshrc"
log_txt warnlistb "aliases"
}
config_scripts() {
# zshrc
FUNC="Configuring Zshrc (exit new session to continue)"
FUNC_OK=true
log_txt a "$FUNC"
if [ -f $HOME/.zshrc ]; then
if [ $(grep "SYSANGEL VERSION" $HOME/.zshrc | wc -l) -le 0 ]; then
mv $HOME/.zshrc $HOME/.zshrc.orig && \
ln -s $(pwd)/files/zshrc_home $HOME/.zshrc
if [ $? != 0 ]; then
FUNC_OK=false
fi
fi
fi
if [[ "$FUNC_OK" != true ]]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
# Fonts
FUNC="Adding new font: Fantasque"
FUNC_OK="true"
log_txt a "$FUNC"
if [ ! -d /usr/share/fonts/truetype/fantasque ]; then
sudo mkdir -p /usr/share/fonts/truetype/fantasque && \
sudo cp files/Fantasque_Sans_Mono_Regular_Nerd_Font_Complete_Mono.ttf /usr/share/fonts/truetype/fantasque/
if [ $? != 0 ]; then
FUNC_OK="false"
fi
else
if [ ! -f /usr/share/fonts/truetype/fantasque/FantasqueSansMono_Regular.ttf ]; then
sudo cp files/Fantasque_Sans_Mono_Regular_Nerd_Font_Complete_Mono.ttf /usr/share/fonts/truetype/fantasque/
if [ $? != 0 ]; then
FUNC_OK="false"
fi
fi
fi
if [ "$FUNC_OK" != "true" ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
# Terminator
FUNC="Configuring Terminator"
FUNC_OK="true"
log_txt a "$FUNC"
mkdir -p $HOME/.config/terminator
if [ ! -L $HOME/.config/terminator/config ]; then
mv $HOME/.config/terminator/config $HOME/.config/terminator/config.orig && \
ln -s $(pwd)/files/terminator_config ~/.config/terminator/config
if [ $? != 0 ]; then
FUNC_OK="false"
fi
fi
if [[ "$FUNC_OK" != "true" ]]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
# Vim
# Terminator
FUNC="Configuring Vim"
FUNC_OK="true"
log_txt a "$FUNC"
mkdir -p $HOME/.vim
if [ ! -L $HOME/.vimrc ]; then
mv $HOME/.vimrc $HOME/.vimrc.orig && \
ln -s $(pwd)/files/vimrc $HOME/.vimrc
if [ $? != 0 ]; then
FUNC_OK="false"
fi
fi
if [ "$FUNC_OK" != "true" ]; then
log_txt aerr "$FUNC"
else
log_txt aok "$FUNC"
fi
}
create_dirs
apt_install
install_scripts
config_scripts
latest_considerations