From 9726d5921e1cbaa570df773d6919f703043707f2 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Sun, 30 May 2021 22:56:54 +0200 Subject: [PATCH] made the scripts posix complient --- setup.sh | 37 ++++++++++++++++++++----------------- setup2.sh | 25 +++++++++++++------------ 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/setup.sh b/setup.sh index 5c3d4bc..63e147b 100644 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,4 @@ -!#/bin/sh +#!/bin/sh pacman -Suy --noconfirm echo Installing all the needed pacages from main artix/arch repo @@ -44,28 +44,31 @@ pacman -S \ neofetch \ neovim \ --noconfirm \ -echo Pleas provide a username -read name -useradd -m $name -passwd $name +echo "Pleas profide a username:" +read -r name +useradd -m "$name" +passwd "$name" echo adding user to some basic groups -usermod -a -G wheel $name -usermod -a -G video $name -usermod -a -G uucp $name -mv setup2.sh /home/$user/setup2.sh -chown $user:$user /home/$user/setup2.sh -chmod +x /home/$user/setup2.sh -read -p "pleas uncomment the wheel group to alow the user to use 'sudo':Press Enter to continu" +usermod -a -G wheel "$name" +usermod -a -G video "$name" +usermod -a -G uucp "$name" +mv setup2.sh /home/"$name"/setup2.sh +chown "$name":"$name" /home/"$name"/setup2.sh +chmod +x /home/"$name"/setup2.sh +printf "pleas uncomment the wheel group to alow the user to use 'sudo':Press Enter to continu" +read -r EDITOR=nvim visudo -read -p "The system needs to reboot for the user to be added to the groups. \n \ +printf "The system needs to reboot for the user to be added to the groups. \n \ after reboot log in as the new user \n \ Then run setup2.sh found in your home directory \n \ - \n " -read -p "Press y to reboot or leave blanck to exit setup" confirm + \n press enter to continu \n " +read -r +echo "Press y to reboot or leave blanck to exit setup" +read -r confirm -if [ $confirm = 'y' ] +if [ "$confirm" = "y" ] then reboot else exit 0 - +fi diff --git a/setup2.sh b/setup2.sh index e9953a8..49686d2 100644 --- a/setup2.sh +++ b/setup2.sh @@ -1,12 +1,12 @@ -!#/bin/sh +#!/bin/sh -name = $USER -cd /home/$name +name=$USER +cd /home/"$name" || exit 1 echo installing paru pacage manager git clone https://aur.archlinux.org/paru-bin.git -cd paru-bin +cd paru-bin || exit 1 makepkg -si --noconfirm -cd .. +cd .. || exit 1 rm -R paru-bin echo installing pacages with paru paru @@ -17,17 +17,18 @@ paru -S \ nerd-fonts-iosevka \ noto-fonts-emoji \ git clone https://github.com/ZastianPretorius/config.git -cd config +cd config || exit 1 for entry in * do - mv $entry /home/$name/$entry + mv "$entry" /home/"$name"/"$entry" done -cd +cd || exit 1 mkdir Pictures -cd Pictures +cd Pictures || exit 1 git clone https://github.com/ZastianPretorius/wallpapers.git -read -sp "sudo password:" pass -sudo rc-update add NetworkManager | echo $pass -suso rc-update add lightdm | echo $pass +printf "sudo password:" +read -r pass +echo "$pass" | sudo rc-update add NetworkManager +echo "$pass" | suso rc-update add lightdm