LARBS/root.sh

43 lines
1.9 KiB
Bash
Raw Normal View History

2017-09-25 03:11:10 +02:00
#!/bin/bash
2017-10-06 07:07:48 +02:00
pacman -S --noconfirm --needed dialog || (echo "Error at script start: Are you sure you're running this as the root user? Are you sure you have an internet connection?" && exit)
2017-09-25 03:11:10 +02:00
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m'
2017-09-30 05:31:35 +02:00
error() { dialog --title "Error!" --msgbox "We've run into a fatal-ish error. Check the LARBS.log file for more information" 10 60 && clear && exit ;}
2017-09-25 03:11:10 +02:00
dialog --title "Welcome!" --msgbox "Welcome to Luke's Auto-Rice Bootstrapping Script!\n\nThis script will automatically install a fully-featured i3wm Arch Linux desktop, which I use as my main machine.\n\n-Luke" 10 60
dialog --no-cancel --inputbox "First, please enter a name for the user account." 10 60 2> name
dialog --no-cancel --passwordbox "Enter a password for that user." 10 60 2> pass1
dialog --no-cancel --passwordbox "Reype password." 10 60 2> pass2
while [ $(cat pass1) != $(cat pass2) ]
do
dialog --no-cancel --passwordbox "Passwords do not match.\n\nEnter password again." 10 60 2> pass1
dialog --no-cancel --passwordbox "Reype password." 10 60 2> pass2
done
USER=$(cat name)
rm name
useradd -m -g wheel -s /bin/bash $USER
echo "$USER:$(cat pass1)" | chpasswd
#I shred the password for safety's sake.
shred -u pass1
shred -u pass2
2017-10-05 21:23:41 +02:00
touch .firstrun
2017-10-05 21:01:12 +02:00
curl -O http://lukesmith.xyz/larbs/install_packages.sh && bash install_packages.sh
2017-10-05 21:23:41 +02:00
rm .firstrun
2017-09-25 03:11:10 +02:00
printf "${BLUE}Enabling Network Manager...\n${NC}"
systemctl enable NetworkManager
systemctl start NetworkManager
2017-09-25 08:26:28 +02:00
2017-09-29 04:44:36 +02:00
curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/sudoers > /etc/sudoers
2017-09-25 08:26:28 +02:00
2017-09-27 18:14:13 +02:00
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" 12 80
clear