Skip to content

Commit 4a2f87f

Browse files
committed
[update] : Use variable for aur user name
1 parent 0d0442c commit 4a2f87f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

system/aur.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#
99
set -e -u
1010

11+
aur_username="aurbuild"
12+
13+
1114
# Delete file only if file exists
1215
# remove <file1> <file2> ...
1316
function remove () {
@@ -37,13 +40,13 @@ function user_check () {
3740
}
3841

3942
# Creating a aur user.
40-
if [[ $(user_check aurbuild) = false ]]; then
41-
useradd -m -d "/aurbuild_temp" aurbuild
43+
if [[ $(user_check ${aur_username}) = false ]]; then
44+
useradd -m -d "/aurbuild_temp" "${aur_username}"
4245
fi
4346
mkdir -p "/aurbuild_temp"
4447
chmod 700 -R "/aurbuild_temp"
45-
chown aurbuild:aurbuild -R "/aurbuild_temp"
46-
echo "aurbuild ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/aurbuild"
48+
chown ${aur_username}:${aur_username} -R "/aurbuild_temp"
49+
echo "${aur_username} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/aurbuild"
4750

4851
# Setup keyring
4952
pacman-key --init

0 commit comments

Comments
 (0)