Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Code cleanup and improvements (version 1.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaptaG authored Jul 4, 2022
1 parent fc730d2 commit b8e646a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions CAAIS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -e

# Definitions
ver=1.2
ver=1.3
fname=$(basename $0)

caais-exit() {
Expand All @@ -26,20 +26,21 @@ fi
caais() {
# Installing keys
echo 'Installing the Chaotic-AUR keys...'
pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com
pacman-key --lsign-key FBA220DFC880C036
pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com > /dev/null 2>&1
pacman-key --lsign-key FBA220DFC880C036 > /dev/null 2>&1

# Downloading the keyring and the mirrorlist
echo 'Downloading the keyring...'
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' --noconfirm > /dev/null 2>&1

echo 'Downloading the mirrorlist...'
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm > /dev/null 2>&1

# Checking if Chaotic-AUR is already appended in pacman.conf, if not skip
echo 'Appending Chaotic-AUR to the mirrorlist...'

if grep 'chaotic-aur' /etc/pacman.conf; then
appendInPacmanConf=$(grep 'chaotic-aur' /etc/pacman.conf)
if [ $appendInPacmanConf -eq 0 ]; then
echo 'Chaotic-AUR is already append in pacman.conf, skipping...'
else
echo -e '\r\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' >> /etc/pacman.conf
Expand All @@ -52,7 +53,7 @@ caais() {
read answer

case "$answer" in
[yY]*)
[yY]* | "")
pacman -Syu
;;
*)
Expand Down

0 comments on commit b8e646a

Please sign in to comment.