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