From 6debd6b5f5975026ae3e181b7536050017344c9a Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Sat, 15 Oct 2016 17:20:04 +0100
Subject: [PATCH] Do interactive app configuration before installing base
 system

---
 src/freedombone-config         |  1 +
 src/freedombone-utils-selector | 46 ++++++++++++++++++----------------
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/src/freedombone-config b/src/freedombone-config
index 2bc1e4365..002dbd082 100755
--- a/src/freedombone-config
+++ b/src/freedombone-config
@@ -1345,6 +1345,7 @@ function interactive_config {
     choose_static_ip
     choose_default_domain_name
     choose_email_address
+    install_apps_interactive
 
     # delete the temporary configuration file
     if [ -f temp.cfg ]; then
diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector
index ec969d5f1..9ab9447d3 100755
--- a/src/freedombone-utils-selector
+++ b/src/freedombone-utils-selector
@@ -402,32 +402,36 @@ function remove_apps {
     update_installed_apps_list
 }
 
+function install_apps_interactive {
+    echo $"Interactive installer"
+    app_index=0
+    for a in "${APPS_AVAILABLE[@]}"
+    do
+        echo -n "${a}"
+        if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
+            echo -n $" not installed"
+            if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
+                echo -n $" chosen"
+                # interactively obtain settings for this app
+                if [[ $(function_exists install_interactive_${a}) == "1" ]]; then
+                    echo -n $" interactive"
+                    install_interactive_${a}
+                fi
+            fi
+        fi
+        echo ""
+
+        app_index=$[app_index+1]
+    done
+    echo $"Interactive settings complete"
+}
+
 function install_apps {
     is_interactive=$1
 
     # interactive install configuration for each app
     if [ ${is_interactive} ]; then
-        echo $"Interactive installer"
-        app_index=0
-        for a in "${APPS_AVAILABLE[@]}"
-        do
-            echo -n "${a}"
-            if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
-                echo -n $" not installed"
-                if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
-                    echo -n $" chosen"
-                    # interactively obtain settings for this app
-                    if [[ $(function_exists install_interactive_${a}) == "1" ]]; then
-                        echo -n $" interactive"
-                        install_interactive_${a}
-                    fi
-                fi
-            fi
-            echo ""
-
-            app_index=$[app_index+1]
-        done
-        echo $"Interactive settings complete"
+        install_apps_interactive
     fi
 
     # now install the apps
-- 
GitLab