norisa.sh 983 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. pacman -Sy --noconfirm git vim || { printf "Error at script start:\n\nAre you sure you're running this as the root user?\n\t(Tip: run 'whoami' to check)\n\nAre you sure you have an internet connection?\n\t(Tip: run 'ip a' to check)\n"; exit; }
  3. # make new user
  4. sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
  5. read -p "What is your desired username? " username
  6. useradd -m -g users -G wheel $username
  7. passwd $username
  8. cd /home/$username
  9. # setting up build environment
  10. mkdir -p ~/.build && cd ~/.build
  11. # install aur helper (pacaur)
  12. cd /tmp || exit
  13. pacman -S --noconfirm expac jq
  14. rm -rf /tmp/pacaur*
  15. curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz &&
  16. sudo -u "$username" tar -xvf yay.tar.gz
  17. cd yay
  18. sudo -u "$username" makepkg --noconfirm -si
  19. cd /tmp || exit
  20. curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/pacaur.tar.gz &&
  21. sudo -u "$username" tar -xvf pacaur.tar.gz
  22. cd pacaur
  23. sudo -u "$username" makepkg --noconfirm -si