From 99a7529209fc77de3375e0bb23fd68d1b97c855d Mon Sep 17 00:00:00 2001 From: Fincer Date: Fri, 18 Nov 2016 19:13:45 +0200 Subject: [PATCH] Quickfix for a question --- data/linux/openra-installscript.sh | 6 +++++- linux-install.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/linux/openra-installscript.sh b/data/linux/openra-installscript.sh index 0d28fac..14e79a5 100755 --- a/data/linux/openra-installscript.sh +++ b/data/linux/openra-installscript.sh @@ -160,7 +160,7 @@ if [[ $(echo $response | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then read -r -p "Please type 1 or 2 (Default: 2): " number attempts=5 - while [[ ! $(echo $number | sed 's/ //g') -eq 1 && ! $(echo $number | sed 's/ //g') -eq 2 ]]; do + while [[ ! $(echo $number | sed 's/ //g') -eq 1 && ! $(echo $number | sed 's/ //g') -eq 2 && ! $(echo $number | sed 's/ //g') == "" ]]; do attempts=$(($attempts -1)) if [[ $attempts -eq 0 ]]; then echo -e "\nMaximum attempts reached. Aborting.\n" @@ -171,6 +171,10 @@ if [[ $(echo $response | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then let number=$(echo $number | sed 's/ //g') done + if [[ $number == "" ]]; then + let number=2 + fi + sleep 1 echo -e "\nDune 2 -- Question\n" diff --git a/linux-install.sh b/linux-install.sh index bbfdd76..addc9fd 100755 --- a/linux-install.sh +++ b/linux-install.sh @@ -88,7 +88,7 @@ if [[ $DISTRO =~ "$ARCH" ]]; then read -r -p "Please type 1 or 2 (Default: 2): " number attempts=5 - while [[ ! $(echo $number | sed 's/ //g') -eq 1 && ! $(echo $number | sed 's/ //g') -eq 2 ]]; do + while [[ ! $(echo $number | sed 's/ //g') -eq 1 && ! $(echo $number | sed 's/ //g') -eq 2 && ! $(echo $number | sed 's/ //g') == "" ]]; do attempts=$(($attempts -1)) if [[ $attempts -eq 0 ]]; then echo -e "\nMaximum attempts reached. Aborting.\n" @@ -99,6 +99,10 @@ if [[ $DISTRO =~ "$ARCH" ]]; then let number=$(echo $number | sed 's/ //g') done + if [[ $number == "" ]]; then + let number=2 + fi + sleep 1 rm $WORKING_DIR/data/linux/arch_linux/*.patch