From 4a2f87f0c65bc985942ead2df715ee3e6cae352f Mon Sep 17 00:00:00 2001 From: hayao Date: Mon, 14 Dec 2020 18:32:04 +0900 Subject: [PATCH] [update] : Use variable for aur user name --- system/aur.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/system/aur.sh b/system/aur.sh index 7ff6bc41..bb1def3c 100755 --- a/system/aur.sh +++ b/system/aur.sh @@ -8,6 +8,9 @@ # set -e -u +aur_username="aurbuild" + + # Delete file only if file exists # remove ... function remove () { @@ -37,13 +40,13 @@ function user_check () { } # Creating a aur user. -if [[ $(user_check aurbuild) = false ]]; then - useradd -m -d "/aurbuild_temp" aurbuild +if [[ $(user_check ${aur_username}) = false ]]; then + useradd -m -d "/aurbuild_temp" "${aur_username}" fi mkdir -p "/aurbuild_temp" chmod 700 -R "/aurbuild_temp" -chown aurbuild:aurbuild -R "/aurbuild_temp" -echo "aurbuild ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/aurbuild" +chown ${aur_username}:${aur_username} -R "/aurbuild_temp" +echo "${aur_username} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/aurbuild" # Setup keyring pacman-key --init -- 2.11.0