set and source scripthome

This commit is contained in:
fenris 2021-12-09 19:56:54 +01:00
parent 1b81bef254
commit c8628e395c
4 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,7 @@ echo -ne "
Automated Arch Linux Installer
-------------------------------------------------------------------------
"
source /root/installscripthome.conf
source $SCRIPTHOME/setup.conf
echo -ne "
-------------------------------------------------------------------------
@ -113,6 +114,7 @@ if [ $(whoami) = "root" ]; then
# use chpasswd to enter $username:$password
echo "$username:$password" | chpasswd
cp -R /root/$SCRIPTHOME /home/$username/
cp /root/installscripthome.conf /home/$username/installscripthome.conf
chown -R $username: /home/$username/$SCRIPTHOME
# enter $hostname to /etc/hostname
echo $hostname > /etc/hostname

View File

@ -14,6 +14,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 installscripthome.conf
source $SCRIPTHOME/setup.conf
cd ~

View File

@ -14,6 +14,7 @@ echo -ne "
Final Setup and Configurations
GRUB EFI Bootloader Install & Check
"
source /root/installscripthome.conf
source $SCRIPTHOME/setup.conf
if [[ -d "/sys/firmware/efi" ]]; then
grub-install --efi-directory=/boot ${DISK}
@ -58,5 +59,10 @@ 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 /root/installscripthome.conf
rm -r /home/$username/$SCRIPTHOME
rm -r /home/$username/installscripthome.conf
# Replace in the same state
cd $pwd

View File

@ -18,6 +18,7 @@ echo -ne "
bash startup.sh
source setup.conf
bash 0-preinstall.sh
echo "SCRIPTHOME=$SCRIPTHOME" >> /mnt/root/installscripthome.conf
arch-chroot /mnt /root/$SCRIPTHOME/1-setup.sh
arch-chroot /mnt /usr/bin/runuser -u $username -- /home/$username/$SCRIPTHOME/2-user.sh
arch-chroot /mnt /root/$SCRIPTHOME/3-post-setup.sh