From 75afb7dc98e46dad3bff8013b5a9caaa0db774f8 Mon Sep 17 00:00:00 2001
From: i-bird <i-bird@localhost.localdomain>
Date: Fri, 29 Jan 2021 14:03:16 +0100
Subject: [PATCH] Adding default choice

---
 script/show_solutions | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/script/show_solutions b/script/show_solutions
index c1f49a6a2..3d0ab7424 100755
--- a/script/show_solutions
+++ b/script/show_solutions
@@ -2,10 +2,6 @@
 
 function possible_solutions {
 
- if [ $sq -eq 1 ]; then
-   return
- fi
-
  sol=1
  echo "Possible solutions:"
  for com in "$@"
@@ -18,8 +14,13 @@ function possible_solutions {
  sol=`expr $sol + 1`
  echo "$sol exit the script"
  echo -e "\033[1;34;5mChoose the solution:\033[0m"
- if [ -f default_choice ]; then
-   choose=$(cat default_choice)
+ if [ $sq -eq 1 ]; then
+   if [ -f cat default_choice ]; then
+     choose=$(cat default_choice)
+   else
+     echo "No solution choosen, continue ... "
+     return
+   fi
  else
    read choose
  fi
-- 
GitLab