-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchaotic-aur.sh
More file actions
executable file
·45 lines (38 loc) · 1.15 KB
/
chaotic-aur.sh
File metadata and controls
executable file
·45 lines (38 loc) · 1.15 KB
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
#!/usr/bin/env bash
set -e
newline() { echo ""; }
update_system() {
newline
sudo pacman -Syu --noconfirm
echo "System updated successfully."
}
add_keys() {
sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
sudo pacman-key --lsign-key 3056513887B78AEB
}
install_chaotic() {
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
}
update_pacman_config() {
if ! grep -q "\[chaotic-aur\]" /etc/pacman.conf; then
echo "#Chaotic-AUR" | sudo tee -a /etc/pacman.conf >/dev/null
echo "" | sudo tee -a /etc/pacman.conf >/dev/null
echo "[chaotic-aur]" | sudo tee -a /etc/pacman.conf >/dev/null
echo "Include = /etc/pacman.d/chaotic-mirrorlist" | sudo tee -a /etc/pacman.conf >/dev/null
fi
}
if pacman -Qi chaotic-keyring &>/dev/null; then
newline
echo "Chaotic AUR is already installed,"
echo "Updating system"
update_system
else
newline
echo "Chaotic AUR is not installed. Installing Chaotic AUR..."
newline
add_keys
install_chaotic
update_pacman_config
update_system
fi