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
This commit is contained in:
Nicholas 2021-10-27 23:59:29 -07:00
parent 92495887b2
commit da91152e73
8 changed files with 39 additions and 32 deletions

View File

@ -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 "--------------------------------------"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

29
archtitus.sh Normal file
View File

@ -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')
###############################################################################
"

View File

@ -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

View File

@ -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