From da91152e7398e24bdbb7f27e95e42b1a6fd9b8da Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 27 Oct 2021 23:59:29 -0700 Subject: [PATCH 1/3] Errored out - Testing Dynamic filename Need to find way to get the name of the file containing all scripts without getting '.' when in the that directory, perhaps just another if statement --- 0-preinstall.sh | 2 +- 1-setup.sh | 11 +++-------- 2-user.sh | 4 ++-- 3-post-setup.sh | 10 +--------- archnikus.sh | 9 --------- archtitus.sh | 29 +++++++++++++++++++++++++++++ kderice-backup.sh | 2 +- kderice-restore.sh | 4 ++-- 8 files changed, 39 insertions(+), 32 deletions(-) delete mode 100644 archnikus.sh create mode 100644 archtitus.sh diff --git a/0-preinstall.sh b/0-preinstall.sh index 0032271..d8eeef6 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -105,7 +105,7 @@ linux /vmlinuz-linux initrd /initramfs-linux.img options root=LABEL=ROOT rw rootflags=subvol=@ EOF -cp -R ~/$PROJECTNAME /mnt/root/ +cp -R ~/$SCRIPTHOME /mnt/root/ cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist echo "--------------------------------------" diff --git a/1-setup.sh b/1-setup.sh index cee3540..5a86ad3 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -264,11 +264,6 @@ elif lspci | grep -E "Integrated Graphics Controller"; then pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils --needed --noconfirm fi -# -# create a swapfile -# $ required for completion of scripts on lower end systems (under 8GB ram will need swap) -# - SWAPSIZEgb=2 SWAPSIZEmb=$((1024*$SWAPSIZEgb)) @@ -286,14 +281,14 @@ echo -e "Swap /swapfile created and configured wtih $SWAPSIZEgb GB\n" echo -e "\nDone!\n" if ! source install.conf; then read -p "Please enter username:" username -echo "username=$username" >> ${HOME}/$PROJECTNAME/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 /root/$PROJECTNAME /home/$username/ - chown -R $username: /home/$username/$PROJECTNAME + cp -R /root/$SCRIPTHOME /home/$username/ + chown -R $username: /home/$username/$SCRIPTHOME else echo "You are already a user proceed with aur installs" fi diff --git a/2-user.sh b/2-user.sh index a498352..8c8e4de 100755 --- a/2-user.sh +++ b/2-user.sh @@ -54,9 +54,9 @@ for PKG in "${PKGS[@]}"; do done export PATH=$PATH:~/.local/bin -cp -r $HOME/$PROJECTNAME/dotfiles/* $HOME/.config/ +cp -r $HOME/$SCRIPTHOME/dotfiles/* $HOME/.config/ pip install konsave -konsave -i $HOME/$PROJECTNAME/kde.knsv +konsave -i $HOME/$SCRIPTHOME/kde.knsv sleep 1 konsave -a kde diff --git a/3-post-setup.sh b/3-post-setup.sh index 277b569..2ede8fa 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -41,12 +41,4 @@ echo " # Remove no password sudo rights sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers # Add sudo rights -sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers - -# Replace in the same state -cd $pwd -echo " -############################################################################### -# Done - Please Eject Install Media and Reboot -############################################################################### -" +sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers \ No newline at end of file diff --git a/archnikus.sh b/archnikus.sh deleted file mode 100644 index fd08e23..0000000 --- a/archnikus.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -PROJECTNAME="ArchNikus" - - bash 0-preinstall.sh - arch-chroot /mnt /root/$PROJECTNAME/1-setup.sh - source /mnt/root/$PROJECTNAME/install.conf - arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$PROJECTNAME/2-user.sh - arch-chroot /mnt /root/$PROJECTNAME/3-post-setup.sh \ No newline at end of file diff --git a/archtitus.sh b/archtitus.sh new file mode 100644 index 0000000..c8f7274 --- /dev/null +++ b/archtitus.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Find the name of the folder the scripts are in + +# X! Still erroring out, doesnt get the directory no matter what. + +if [ -L $0 ] ; then + ME=$(readlink $0) +else + ME=$0 +fi +dir=$(dirname $ME) + +export SCRIPTHOME="$(basename -- $dir)" +echo "Scripts are in dir named $SCRIPTHOME" + + bash 0-preinstall.sh + arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh + source /mnt/root/$SCRIPTHOME/install.conf + arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh + arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh + +# Replace in the same state +cd $PWD +echo " +############################################################################### +# Done - Please Eject Install Media and Reboot (you can just type 'reboot') +############################################################################### +" \ No newline at end of file diff --git a/kderice-backup.sh b/kderice-backup.sh index 3c45d7a..883e40a 100755 --- a/kderice-backup.sh +++ b/kderice-backup.sh @@ -1,5 +1,5 @@ #!/bin/bash -cp -r $HOME/.config/kitty $HOME/$PROJECTNAME/dotfiles/kitty +cp -r $HOME/.config/kitty $HOME/$SCRIPTHOME/dotfiles/kitty konsave -s kde konsave -e kde \ No newline at end of file diff --git a/kderice-restore.sh b/kderice-restore.sh index fb26bc6..4b3a481 100755 --- a/kderice-restore.sh +++ b/kderice-restore.sh @@ -1,8 +1,8 @@ #!/bin/bash export PATH=$PATH:~/.local/bin -cp -r $HOME/$PROJECTNAME/dotfiles/* $HOME/.config/ +cp -r $HOME/$SCRIPTHOME/dotfiles/* $HOME/.config/ pip install konsave -konsave -i $HOME/$PROJECTNAME/kde.knsv +konsave -i $HOME/$SCRIPTHOME/kde.knsv sleep 1 konsave -a kde From f72b9a56995477f71a900277928aa44cb7d32032 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 28 Oct 2021 13:55:23 -0700 Subject: [PATCH 2/3] Potential Solution to Scripthome var getting . as its value (but i hate it) --- archtitus.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/archtitus.sh b/archtitus.sh index c8f7274..5f1f187 100644 --- a/archtitus.sh +++ b/archtitus.sh @@ -3,7 +3,10 @@ # Find the name of the folder the scripts are in # X! Still erroring out, doesnt get the directory no matter what. +# Found potential Solution +# I hate it +cd / if [ -L $0 ] ; then ME=$(readlink $0) else @@ -13,6 +16,7 @@ dir=$(dirname $ME) export SCRIPTHOME="$(basename -- $dir)" echo "Scripts are in dir named $SCRIPTHOME" +cd $PWD bash 0-preinstall.sh arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh From d3b28199e9b1137d57c53eb281b345e0b5ca860e Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 28 Oct 2021 18:55:57 -0700 Subject: [PATCH 3/3] AHHHHHHHHHHHH very simple solution --- archtitus.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/archtitus.sh b/archtitus.sh index 5f1f187..7073498 100644 --- a/archtitus.sh +++ b/archtitus.sh @@ -3,18 +3,9 @@ # Find the name of the folder the scripts are in # X! Still erroring out, doesnt get the directory no matter what. -# Found potential Solution # I hate it -cd / -if [ -L $0 ] ; then - ME=$(readlink $0) -else - ME=$0 -fi -dir=$(dirname $ME) - -export SCRIPTHOME="$(basename -- $dir)" +export SCRIPTHOME="$(basename -- $PWD)" echo "Scripts are in dir named $SCRIPTHOME" cd $PWD