-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·74 lines (65 loc) · 1.4 KB
/
bootstrap.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
#! /bin/bash -e
groups=(
"base-devel"
)
forceclose() {
echo -e "\n\nForcing script termination..."
sleep 0.5s
echo -e "Terminated. Bye!"
}
trap forceclose EXIT
userrepository() {
local cont
read -p "Continue adding userrepository repo (Y/n)?" cont
if [[ ${cont,,} =~ ^(yes|y| ) ]] || [[ -z ${cont,,} ]]; then
echo -e "Adding userrepository to /etc/pacman.conf..."
sudo tee -a /etc/pacman.conf <<EOD
[userrepository]
Server = https://userrepository.eu
SigLevel = Optional TrustAll
EOD
echo -e "Done.\n"
sleep 2s
else
echo -e "Skipped an essential step. Aborting..."
exit 0
fi
}
refresh() {
echo -e "Userrepository enabled. Now refreshing mirrors and installing any updates available..."
sudo pacman -Syyuv --noconfirm
echo -e "Done.\n"
sleep 2s
}
groupinstall() {
local cont
read -p "Continue adding required groups (Y/n)?" cont
if [[ ${cont,,} =~ ^(yes|y| ) ]] || [[ -z ${cont,,} ]]; then
echo -e "Installing base groups..."
sudo pacman -Syuv "${groups[@]}"
echo -e "Done.\n"
sleep 2s
else
echo "Skipped..."
fi
}
metapackage() {
local cont
read -p "Continue building metapackage (Y/n)?" cont
if [[ ${cont,,} =~ ^(yes|y| ) ]] || [[ -z ${cont,,} ]]; then
echo -e "Building and installing metapackage..."
makepkg -C -c -d -f -i
echo -e "Done.\n"
sleep 2s
else
echo "Skipped..."
fi
}
finish() {
echo -e "All done.\n"
}
userrepository
refresh
groupinstall
metapackage
finish