From 5733122a1fe3d02a0c619f72574dfe88f89e2f33 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 6 Jan 2022 13:10:11 -0600 Subject: [PATCH] Fix Script Setup file --- 1-setup.sh | 2 +- 2-user.sh | 2 +- archtitus.sh | 5 +++-- startup.sh | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 089c15c..cbd9511 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -110,7 +110,7 @@ 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 #SETUP IS WRONG THIS IS RUN -if ! source setup.conf; then +if ! source /root/ArchTitus/setup.conf; then # Loop through user input until the user gives a valid username while true do diff --git a/2-user.sh b/2-user.sh index e47f994..27dba51 100755 --- a/2-user.sh +++ b/2-user.sh @@ -15,7 +15,7 @@ echo -ne " 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 ~/ArchTitus/setup.conf +source $HOME/ArchTitus/setup.conf cd ~ git clone "https://aur.archlinux.org/yay.git" diff --git a/archtitus.sh b/archtitus.sh index 609e0b7..adb1d2d 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -1,7 +1,8 @@ #!/bin/bash # Find the name of the folder the scripts are in -export SCRIPTHOME="$(basename -- $PWD)" + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ @@ -16,7 +17,7 @@ echo -ne " Scripts are in directory named ArchTitus " bash startup.sh - source setup.conf + source $SCRIPT_DIR/setup.conf bash 0-preinstall.sh arch-chroot /mnt /root/ArchTitus/1-setup.sh arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/ArchTitus/2-user.sh diff --git a/startup.sh b/startup.sh index 60b083a..e497434 100644 --- a/startup.sh +++ b/startup.sh @@ -3,8 +3,9 @@ # like disk, file system, timezone, keyboard layout, # user name, password, etc. +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # set up a config file -CONFIG_FILE=setup.conf +CONFIG_FILE=$SCRIPT_DIR/setup.conf if [ ! -f $CONFIG_FILE ]; then # check if file exists touch -f $CONFIG_FILE # create file if not exists fi