#!/bin/bash INSTALL_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $INSTALL_SCRIPT_DIR/config.sh source $INSTALL_SCRIPT_DIR/colors.sh source $INSTALL_SCRIPT_DIR/programs/os_install.sh exit_abord() { color_start "themeError" echo "#############################################" echo "# Linux instalation Script Has been aborded #" echo "#############################################" color_stop } exit_sucsess() { color_start "themeSuccess" echo "###################################################" echo "# Linux instalation Script Has ended with Sucsess #" echo "###################################################" color_stop } color_start "themeGreetings" echo "###########################################" echo "# Wellcome to my Linux instalation Script #" echo "###########################################" color_stop echo "" color_start "themeIndication" echo "-------------------------------------------" echo "The Following programms will be installed :" echo "-------------------------------------------" color_stop color_start "themeFocus" for i in "${!common_programs_list[@]}"; do printf "${common_programs_list[$i]} | " done color_stop echo "" echo "" color_start "themeInput" echo "---------------------" echo "Please Select your OS" echo "---------------------" color_stop color_start "themeSelect" for i in "${!os_list[@]}"; do echo "[$(($i + 1))] ${os_list[$i]}" done color_stop color_start "themeInput" echo "---------------------" color_stop echo "" color_start "themeUserInput" read -p "Select your os or ( q to quit ) : " answer color_stop echo "" if [[ "$answer" == "q" ]]; then exit_abord else if [ $answer -lt $(($os_list_count + 1)) ]; then answer=$(( $answer - 1 )) OS=${os_list[$answer]} install_"$OS" else echo " the given nurber was not correct >>ABORDING<<" exit_abord fi fi