move aurbuilder sudo right to /etc/sudoers.d/aurbuilder

This commit is contained in:
MatMoul 2015-10-13 21:48:25 +02:00
parent 495d1d3b3e
commit 3c2314a07d
2 changed files with 5 additions and 3 deletions

View file

@ -48,7 +48,9 @@ case $sel in
sudoers=$(ls /etc/sudoers.d)
sudoerlist=()
for itm in $sudoers; do
if [ ! "$itm" = "aurbuilder" ]; then
sudoerlist+=("$itm" "")
fi
done
sel=$(whiptail --backtitle "$apptitle" --title "Delete sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \
"${sudoerlist[@]}" \

View file

@ -45,8 +45,8 @@ checkaurdependencies(){
newpass=$(< /dev/urandom tr -dc "@#*%&_A-Z-a-z-0-9" | head -c16)
useradd -r -N -M -d /home/.aurbuilder -s /usr/bin/nologin aurbuilder
echo -e "$newpass\n$newpass\n"|passwd aurbuilder
echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "root ALL=(aurbuilder) NOPASSWD: ALL" >> /etc/sudoers
echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aurbuilder
echo "root ALL=(aurbuilder) NOPASSWD: ALL" >> /etc/sudoers.d/aurbuilder
newpass=""
fi
}