Addition of sudoers file, new package management.

This commit is contained in:
Luke 2017-09-24 23:11:46 -07:00
parent da34083062
commit 5d59b2173d
3 changed files with 91 additions and 7 deletions

40
root.sh
View file

@ -26,8 +26,39 @@ echo "$USER:$(cat pass1)" | chpasswd
#I shred the password for safety's sake. #I shred the password for safety's sake.
shred -u pass1 shred -u pass1
shred -u pass2 shred -u pass2
printf "${BLUE}Now installing main programs.\n${NC}"
pacman --noconfirm --needed -S base-devel xorg-xinit xorg-server rxvt-unicode feh ffmpeg pulseaudio pulseaudio-alsa arandr pavucontrol pamixer mpv wget rofi vim w3m ranger mediainfo poppler highlight tmux calcurse htop newsbeuter mpd mpc ncmpcpp network-manager-applet networkmanager qutebrowser imagemagick transmission-cli atool libcaca compton transset-df blender gimp texlive-most texlive-lang markdown mupdf evince rsync git youtube-dl youtube-viewer noto-fonts-cjk noto-fonts-emoji cups screenfetch scrot unzip unrar biber ntfs-3g offlineimap msmtp notmuch notmuch-mutt dosfstools fzf r cmd=(dialog --separate-output --checklist "Select options:" 22 76 16)
options=(1 "LaTeX packages" off # any option can be set to default to "on"
2 "Libreoffice Suite" off
3 "GIMP" off
4 "Blender" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
printf "\n${BLUE}Now installing main programs.\n${NC}"
pacman --noconfirm --needed -S base-devel xorg-xinit xorg-server rxvt-unicode feh ffmpeg pulseaudio pulseaudio-alsa arandr pavucontrol pamixer mpv wget rofi vim w3m ranger mediainfo poppler highlight tmux calcurse htop newsbeuter mpd mpc ncmpcpp network-manager-applet networkmanager qutebrowser imagemagick transmission-cli atool libcaca compton transset-df markdown mupdf evince rsync git youtube-dl youtube-viewer noto-fonts-cjk noto-fonts-emoji cups screenfetch scrot unzip unrar ntfs-3g offlineimap msmtp notmuch notmuch-mutt dosfstools fzf r
for choice in $choices
do
case $choice in
1)
printf "\n${BLUE}Now installing LaTeX packages...\n${NC}"
pacman --noconfirm --needed -S texlive-most texlive-lang biber
;;
2)
printf "\n${BLUE}Now installing Libreoffice suite...\n${NC}"
pacman --noconfirm --needed -S libreoffice-fresh
;;
3)
printf "\n${BLUE}Now installing GIMP...\n${NC}"
pacman --noconfirm --needed -S gimp
;;
4)
printf "\n${BLUE}Now installing Blender...\n${NC}"
pacman --noconfirm --needed -S blender
;;
esac
done
#pacman --noconfirm --needed -S projectm-pulseaudio
printf "${BLUE}Enabling Network Manager...\n${NC}" printf "${BLUE}Enabling Network Manager...\n${NC}"
systemctl enable NetworkManager systemctl enable NetworkManager
@ -40,5 +71,6 @@ printf "${BLUE}Running script as new user $USER...\n${NC}"
cp /etc/sudoers /etc/sudoers.prelarbs cp /etc/sudoers /etc/sudoers.prelarbs
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
sudo -u $USER bash /home/$USER/user.sh sudo -u $USER bash /home/$USER/user.sh
curl http://lukesmith.xyz/larbs/sudoers > /etc/sudoers curl http://lukesmith.xyz/larbs/sudoers.sh > /etc/sudoers
dialog --title "All done!" --msgbox "Congrats! Provided there were no hidden errors, the script completed successfully and all the programs and configuration files should be in place.\n\nTo run the new graphical environment, log out and log back in as your new user, then run the command \"startx\" to start the graphical environment.\n\n-Luke" 10 60 chown root:root /etc/sudoers.file
dialog --title "All done!" --msgbox "Congrats! Provided there were no hidden errors, the script completed successfully and all the programs and configuration files should be in place.\n\nTo run the new graphical environment, log out and log back in as your new user, then run the command \"startx\" to start the graphical environment.\n\n-Luke" 20 80

51
sudoers.sh Normal file
View file

@ -0,0 +1,51 @@
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##
##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3
##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef
##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
# Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"

View file

@ -20,14 +20,15 @@ rm packer.tar.gz
printf "${BLUE}Installing AUR programs...\n${NC}" printf "${BLUE}Installing AUR programs...\n${NC}"
printf "${BLUE}(May take some time.)\n${NC}" printf "${BLUE}(May take some time.)\n${NC}"
packer --noconfirm -S cli-visualizer i3-gaps vim-pathogen vim-live-latex-preview neofetch i3lock tamzen-font-git speedometer neomutt transmission-remote-cli-git ncpamixer-git unclutter-xfixes-git urxvt-resize-font-git ttf-ancient-fonts polybar-git python-pywal xfce-theme-blackbird packer --noconfirm -S i3-gaps vim-pathogen vim-live-latex-preview neofetch i3lock tamzen-font-git neomutt transmission-remote-cli-git unclutter-xfixes-git urxvt-resize-font-git ttf-ancient-fonts polybar-git python-pywal xfce-theme-blackbird
#packer --noconfirm -S ncpamixer-git speedometer cli-visualizer
printf "${BLUE}Downloading config files...\n${NC}" printf "${BLUE}Downloading config files...\n${NC}"
git clone https://github.com/lukesmithxyz/voidrice.git git clone https://github.com/lukesmithxyz/voidrice.git
rsync -va --delete-after voidrice/ /home/$USER rsync -va voidrice/ /home/$USER
git clone https://github.com/lukesmithxyz/latex-templates.git git clone https://github.com/lukesmithxyz/latex-templates.git
mkdir -p /home/$USER/Documents/LaTeX mkdir -p /home/$USER/Documents/LaTeX
rsync -va --delete-after latex-templates /home/$USER/Documents/LaTeX rsync -va latex-templates /home/$USER/Documents/LaTeX
sudo rm -rf voidrice sudo rm -rf voidrice
sudo rm -rf latex-templates sudo rm -rf latex-templates
printf "${BLUE}Generating bash/ranger/qutebrowser shortcuts...\n${NC}" printf "${BLUE}Generating bash/ranger/qutebrowser shortcuts...\n${NC}"