From 34674317b399ba21f04143d1b4b54b99e06d8a6b Mon Sep 17 00:00:00 2001 From: 5olu7ion <113297102+5olu7ion@users.noreply.github.com> Date: Sat, 10 Jun 2023 00:38:17 +0200 Subject: [PATCH] Case insensitive User Input (#1475) * Always lower User input --- install/alpine-docker-install.sh | 4 ++-- misc/alpine-install.func | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/alpine-docker-install.sh b/install/alpine-docker-install.sh index 368a4d3f..eacbe6b0 100644 --- a/install/alpine-docker-install.sh +++ b/install/alpine-docker-install.sh @@ -34,7 +34,7 @@ PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer") DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose") read -r -p "Would you like to add Portainer? " prompt -if echo "$prompt" | grep -Eq "^(y|yes)$"; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Installing Portainer $PORTAINER_LATEST_VERSION" docker volume create portainer_data >/dev/null $STD docker run -d \ @@ -49,7 +49,7 @@ if echo "$prompt" | grep -Eq "^(y|yes)$"; then fi read -r -p "Would you like to add Docker Compose? " prompt -if echo "$prompt" | grep -Eq "^(y|yes)$"; then +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION" DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins diff --git a/misc/alpine-install.func b/misc/alpine-install.func index ce38abed..96d1f849 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -86,7 +86,7 @@ network_check() { if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected" read -r -p "Would you like to continue anyway? " prompt - if echo "$prompt" | grep -Eq "^(y|yes)$"; then + if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}" else echo -e " 🖧 Check Network Settings"