arch-automated-installer/start-setup.sh

62 lines
1.8 KiB
Bash
Executable file

#!/bin/bash
if [[ $(whoami) == "root" ]]; then
echo "Do not run as root!"
exit 2
fi
echo ""
echo "==============="
echo " Intro "
echo "==============="
echo ""
# Check for Repos directory
if [[ ! -d /home/$(whoami)/Repos ]]; then
mkdir /home/$(whoami)/Repos
fi
script_PATH=$(pwd)
if [[ -f /bin/apt ]]; then
while true; do
read -p "Are you using a Debian? (y/n)" answer
if [[ "${answer,,}" == "y" ]]; then
bash /home/rodolfo/Repos/arch-automated-installer/debiansetup.sh
break
elif [[ "${answer,,}" == "n" ]]; then
echo "Use a compatible system (Debian/Arch)"
break
else
echo "Invalid input 'y/n'"
fi
done
elif [[ -f /bin/pacman ]]; then
while true; do
read -p "Are you using a Arch? (y/n)" answer
if [[ "${answer,,}" == "y" ]]; then
# Check for git
if [[ ! -f /bin/git ]]; then
echo "Authentication Is Required. Enter $username's password"
sudo pacman -S --noconfirm --needed git
echo ""
fi
# Get the Repo
if [[ ! -d /home/$(whoami)/Repos/arch-automated-installer ]]; then
git clone https://gitea.barcelli.net/rodolfo/arch-automated-installer /home/$(whoami)/Repos/arch-automated-installer
cd /home/$(whoami)/Repos/arch-automated-installer
fi
bash /home/$(whoami)/Repos/arch-automated-installer/archsetup.sh
break
elif [[ "${answer,,}" == "n" ]]; then
echo "Use a compatible system (Debian/Arch)"
break
else
echo "Invalid input 'y/n'"
fi
done
else
echo "Error: Could not identify system."
exit 2
fi