From efb9688a79e5171ac5b8b57accba3d5b38473fe6 Mon Sep 17 00:00:00 2001 From: Christopher Beckmann Date: Tue, 2 May 2023 23:39:11 +0200 Subject: [PATCH] Update 'install.sh' --- install.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index c46eb09..0f72197 100644 --- a/install.sh +++ b/install.sh @@ -4,18 +4,23 @@ function show_help { echo "This is the help" } -while getopts "h?vyi:d" opt; do +while getopts "h?vyi:acrbm:" opt; do case "$opt" in - h|\?) show_help; exit 0 ;; - v) P_Verbose=1 ;; - d) P_Debug=1 ;; - y) P_Yes=1 ;; - i) P_Install=$OPTARG + h|\?) show_help; exit 0 ;; + v) P_Verbose=1 ;; + d) P_Debug=1 ;; + y) P_Yes=1 ;; + a) P_APT=1 ;; + c) P_CONFIG=1 ;; + r) P_RC=1 ;; + b) P_BINARY=1 ;; + i) P_Install=$OPTARG ;; + m) ARCH=$OPTARG ;; esac done ASK="\e[34m" -INFO="\e[90m\e[1m" +INFO="\e[91m\e[1m" ADD="\e[32m\e[1m" ENDCOLOR="\e[0m" @@ -163,6 +168,7 @@ function install_deb_check { } function install_deb { + if [ ! -z "$P_" ]; then return 0; fi log_info "Downloading $2 to $TMP_PATH ..." wget -O $TMP_PATH/$1.deb $2 > /dev/null 2>&1 @@ -187,7 +193,11 @@ function install_deb { } function init { - log_info "$ARCH" + log_info "Found Architecture: $ARCH" + if ! user_confirm "Is '$ARCH' the correct architecture to download programs?"; then + log_info "Exiting ..." + exit 0 + fi log_info "Running apt update ..." sudo apt update > /dev/null 2>&1 mkdir -p $TMP_PATH/