From a6b40493b33fa30ebdcd1efce75b6b9a646991a0 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 6 Jan 2022 12:33:08 -0600 Subject: [PATCH] Fix Bugs fixing various syntax errors and incorrect variables from multiple merges --- 1-setup.sh | 40 +++++++++++++++++++--------------------- 2-user.sh | 10 +++++----- 3-post-setup.sh | 8 ++++---- startup.sh | 4 ++-- 4 files changed, 30 insertions(+), 32 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 21c8454..089c15c 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -9,10 +9,10 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer - SCRIPTHOME: $SCRIPTHOME + SCRIPTHOME: ArchTitus ------------------------------------------------------------------------- " -source /root/$SCRIPTHOME/setup.conf +source /root/ArchTitus/setup.conf echo -ne " ------------------------------------------------------------------------- Network Setup @@ -70,7 +70,7 @@ echo -ne " Installing Base System ------------------------------------------------------------------------- " -cat /root/$SCRIPTHOME/pkg-files/pacman-pkgs.txt | while read line +cat /root/ArchTitus/pkg-files/pacman-pkgs.txt | while read line do echo "INSTALLING: ${line}" sudo pacman -S --noconfirm --needed ${line} @@ -109,8 +109,8 @@ elif grep -E "Integrated Graphics Controller" <<< ${gpu_type}; then elif grep -E "Intel Corporation UHD" <<< ${gpu_type}; then pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm fi - -if ! source install.conf; then +#SETUP IS WRONG THIS IS RUN +if ! source setup.conf; then # Loop through user input until the user gives a valid username while true do @@ -123,17 +123,14 @@ if ! source install.conf; then fi echo "Incorrect username." done -# convert name to lowercase before saving to install.conf -echo "username=${username,,}" >> ${HOME}/${SCRIPTHOME}/install.conf -fi -if [ $(whoami) = "root" ]; -then - useradd -m -G wheel,libvirt -s /bin/bash $username - passwd $username - cp -R ${HOME}/${SCRIPTHOME} /home/${username}/ - chown -R ${username}: /home/${username}/${SCRIPTHOME} +# convert name to lowercase before saving to setup.conf +echo "username=${username,,}" >> ${HOME}/ArchTitus/setup.conf - # Loop through user input until the user gives a valid hostname, but allow the user to force save + #Set Password + read -p "Please enter password:" password +echo "password=${password,,}" >> ${HOME}/ArchTitus/setup.conf + + # Loop through user input until the user gives a valid hostname, but allow the user to force save while true do read -p "Please name your machine:" nameofmachine @@ -143,14 +140,15 @@ then break fi # if validation fails allow the user to force saving of the hostname - read -p "Username doesn't seem correct. Do you still want to save it? (y/n)" force + read -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force if [[ "${force,,}" = "y" ]] then break fi done - echo ${nameofmachine} > /etc/hostname + echo "nameofmachine=${nameofmachine,,}" >> ${HOME}/ArchTitus/setup.conf +fi echo -ne " ------------------------------------------------------------------------- Adding User @@ -162,10 +160,10 @@ if [ $(whoami) = "root" ]; then # use chpasswd to enter $username:$password echo "$USERNAME:$PASSWORD" | chpasswd - cp -R /root/$SCRIPTHOME /home/$USERNAME/ - chown -R $USERNAME: /home/$USERNAME/$SCRIPTHOME -# enter $hostname to /etc/hostname - echo $HOSTNAME > /etc/hostname + cp -R /root/ArchTitus /home/$USERNAME/ + chown -R $USERNAME: /home/$USERNAME/ArchTitus +# enter $nameofmachine to /etc/hostname + echo $nameofmachine > /etc/hostname else echo "You are already a user proceed with aur installs" fi diff --git a/2-user.sh b/2-user.sh index 2c93677..e47f994 100755 --- a/2-user.sh +++ b/2-user.sh @@ -9,13 +9,13 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer - SCRIPTHOME: $SCRIPTHOME + SCRIPTHOME: ArchTitus ------------------------------------------------------------------------- Installing AUR Softwares " # You can solve users running this script as root with this and then doing the same for the next for statement. However I will leave this up to you. -source ~/$SCRIPTHOME/setup.conf +source ~/ArchTitus/setup.conf cd ~ git clone "https://aur.archlinux.org/yay.git" @@ -27,12 +27,12 @@ git clone "https://github.com/ChrisTitusTech/zsh" git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k ln -s "~/zsh/.zshrc" ~/.zshrc -yay -S --noconfirm --needed - < ~/$SCRIPTHOME/pkg-files/aur-pkgs.txt +yay -S --noconfirm --needed - < ~/ArchTitus/pkg-files/aur-pkgs.txt export PATH=$PATH:~/.local/bin -cp -r ~/$SCRIPTHOME/dotfiles/* ~/.config/ +cp -r ~/ArchTitus/dotfiles/* ~/.config/ pip install konsave -konsave -i ~/$SCRIPTHOME/kde.knsv +konsave -i ~/ArchTitus/kde.knsv sleep 1 konsave -a kde diff --git a/3-post-setup.sh b/3-post-setup.sh index f71555a..9690617 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -9,13 +9,13 @@ echo -ne " ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------- Automated Arch Linux Installer - SCRIPTHOME: $SCRIPTHOME + SCRIPTHOME: ArchTitus ------------------------------------------------------------------------- Final Setup and Configurations GRUB EFI Bootloader Install & Check " -source /root/$SCRIPTHOME/setup.conf +source /root/ArchTitus/setup.conf if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} fi @@ -79,8 +79,8 @@ sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /et # Add sudo rights sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers -rm -r /root/$SCRIPTHOME -rm -r /home/$username/$SCRIPTHOME +rm -r /root/ArchTitus +rm -r /home/$username/ArchTitus # Replace in the same state cd $pwd diff --git a/startup.sh b/startup.sh index 4c08ac8..60b083a 100644 --- a/startup.sh +++ b/startup.sh @@ -147,8 +147,8 @@ set_option USERNAME ${username,,} # convert to lower case as in issue #109 echo -ne "Please enter your password: \n" read -s password # read password without echo set_option PASSWORD $password -read -rep "Please enter your hostname: " hostname -set_option HOSTNAME $hostname +read -rep "Please enter your hostname: " nameofmachine +set_option nameofmachine $nameofmachine } # More features in future # language (){}