5 # Email : hayao@fascode.net
7 # (c) 2019-2021 Fascode Network.
11 aur_username="aurbuild"
14 # Delete file only if file exists
15 # remove <file1> <file2> ...
20 for _file in "${_list[@]}"; do
21 if [[ -f ${_file} ]]; then
23 elif [[ -d ${_file} ]]; then
26 echo "${_file} was deleted."
31 function user_check () {
32 if [[ $(getent passwd $1 > /dev/null ; printf $?) = 0 ]]; then
42 # Creating a aur user.
43 if [[ $(user_check ${aur_username}) = false ]]; then
44 useradd -m -d "/aurbuild_temp" "${aur_username}"
46 mkdir -p "/aurbuild_temp"
47 chmod 700 -R "/aurbuild_temp"
48 chown ${aur_username}:${aur_username} -R "/aurbuild_temp"
49 echo "${aur_username} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/aurbuild"
53 #eval $(cat "/etc/systemd/system/pacman-init.service" | grep 'ExecStart' | sed "s|ExecStart=||g" )
54 ls "/usr/share/pacman/keyrings/"*".gpg" | sed "s|.gpg||g" | xargs | pacman-key --populate
58 chmod +s /usr/bin/sudo
59 yes | sudo -u aurbuild \
72 --config "/etc/alteriso-pacman.conf" \
73 --cachedir "/var/cache/pacman/pkg/" \
76 yay -Sccc --noconfirm --config "/etc/alteriso-pacman.conf"
78 # remove user and file
81 remove /etc/sudoers.d/aurbuild
82 remove "/etc/alteriso-pacman.conf"
83 remove "/var/cache/pacman/pkg/"