From 863f6df3f8866c622bd24b5e43ff9c91dac355ae Mon Sep 17 00:00:00 2001 From: Rodolfo Date: Mon, 1 Jul 2024 01:54:26 +0800 Subject: [PATCH] Add start up script --- start-setup.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 start-setup.sh diff --git a/start-setup.sh b/start-setup.sh new file mode 100755 index 0000000..e67ce4c --- /dev/null +++ b/start-setup.sh @@ -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