arch-automated-installer/start-setup.sh

64 lines
1.6 KiB
Bash
Raw Normal View History

2024-06-30 17:54:26 +00:00
#!/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
echo "mkdir /home/$(whoami)/Repos"
fi
# Check for git
if [[ ! -f /bin/git ]]; then
echo "Authentication Is Required. Enter $username's password"
echo "sudo pacman -S --noconfirm --needed git"
echo ""
fi
if [[ ! -d /home/$(whoami)/Repos/arch-automated-installer ]]; then
echo "git clone https://gitea.barcelli.net/rodolfo/arch-automated-installer /home/$(whoami)/Repos/arch-automated-installer"
echo "cd /home/$(whoami)/Repos/arch-automated-installer"
fi
2024-06-30 17:54:26 +00:00
script_PATH=$(pwd)
if [[ -d /etc/apt ]]; then
while true; do
read -p "Are you using a Debian? (y/n)" answer
if [[ "${answer,,}" == "y" ]]; then
echo "bash script_PATH/debiansetup.sh"
break
elif [[ "${answer,,}" == "n" ]]; then
echo "Use a compatible system (Debian/Arch)"
break
else
echo "Invalid input 'y/n'"
fi
done
elif [[ -d /etc/pacman ]]; then
while true; do
read -p "Are you using a Arch? (y/n)" answer
echo "${answer,,}"
if [[ "${answer,,}" == "y" ]]; then
echo "bash script_PATH/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