Add start up script

This commit is contained in:
Rodolfo 2024-07-01 01:54:26 +08:00
parent 537938886d
commit 863f6df3f8

46
start-setup.sh Executable file
View file

@ -0,0 +1,46 @@
#!/bin/bash
if [[ $(whoami) == "root" ]]; then
echo "Do not run as root!"
exit 2
fi
echo ""
echo "==============="
echo " Intro "
echo "==============="
echo ""
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