From de0add2300c6b6ebb81a5178149a026f33b751b2 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Mon, 27 Dec 2021 01:25:30 -0300 Subject: [PATCH] Run makepkg with non-root user --- install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 66d154c..b3bc9c1 100755 --- a/install.sh +++ b/install.sh @@ -120,8 +120,8 @@ getThePackages() { curl -LO "https://raw.githubusercontent.com/santilococo/CocoASAIS/master/packages.csv" > /dev/null 2>&1 fi commOutput=$(command -v paru &> /dev/null) - if [ $? -eq 1 ]; then - runInChroot "cd /tmp; git clone https://aur.archlinux.org/paru.git; cd paru; makepkg -si --noconfirm; cd ..; rm -rf paru" + if [ $? -eq 1 ] && [ ! -z $username ]; then + runInChroot "su -l $username; cd /tmp; git clone https://aur.archlinux.org/paru.git; cd paru; makepkg -si --noconfirm; cd ..; rm -rf paru" fi local IFS=, while read -r NAME IMPORTANT AUR; do @@ -215,7 +215,6 @@ userSetUp() { exitIfCancel "You must enter an username." "userSetUp" askForPassword "${username}" "userSetUp" runInChroot "useradd -m ${username};echo "${username}:${password}" | chpasswd; sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers; usermod -aG wheel ${username}" - unset username unset password }