move aurbuilder sudo right to /etc/sudoers.d/aurbuilder
This commit is contained in:
parent
495d1d3b3e
commit
3c2314a07d
2 changed files with 5 additions and 3 deletions
|
@ -48,7 +48,9 @@ case $sel in
|
|||
sudoers=$(ls /etc/sudoers.d)
|
||||
sudoerlist=()
|
||||
for itm in $sudoers; do
|
||||
sudoerlist+=("$itm" "")
|
||||
if [ ! "$itm" = "aurbuilder" ]; then
|
||||
sudoerlist+=("$itm" "")
|
||||
fi
|
||||
done
|
||||
sel=$(whiptail --backtitle "$apptitle" --title "Delete sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \
|
||||
"${sudoerlist[@]}" \
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue