Advertisement
daddy_jones

darch common script

Dec 21st, 2019
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "nobody darch=NOPASSWD: /usr/bin/pacman" >> /etc/sudoers
  4.  
  5. install_packages() {
  6.     pacman -S --noconfirm "$@"
  7. }
  8.  
  9. clear_package_cache() {
  10.     pacman -Scc --noconfirm
  11.  
  12. }
  13.  
  14. install_aur_package() {
  15.     trizen -S --noconfirm --noedit $1
  16. }
  17.  
  18. create_build_dir() {
  19.     chsh -s /bin/bash nobody
  20.     mkdir /home/build
  21.     chgrp nobody /home/build
  22.     chmod g+ws /home/build
  23.     setfacl -m u::rwx,g::rwx /home/build
  24.     setfacl -d --set u::rwx,g::rwx,o::- /home/build
  25. }
  26.  
  27. install_aur_helper() {
  28.  
  29.     echo "Set disable_coredump false" >> /etc/sudo.conf
  30.  
  31.     pacman -S --noconfirm git
  32.     create_build_dir
  33.  
  34.     #install trizen
  35.     su - nobody -c "git clone https://aur.archlinux.org/trizen.git /home/build/trizen"
  36.     cd /home/build/trizen
  37.     su - nobody  -c "makepkg -si --noconfirm"
  38.     cd ..
  39.     rm -r /home/build/trizen
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement