From f504dd2886955a0f278e5f3f8316025dea53708d Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Fri, 17 Aug 2018 19:48:18 +0100
Subject: [PATCH] Read config params when installing a specific app

---
 src/freedombone-addremove | 4 +++-
 src/freedombone-installer | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/freedombone-addremove b/src/freedombone-addremove
index 41e282648..fc73c22c2 100755
--- a/src/freedombone-addremove
+++ b/src/freedombone-addremove
@@ -230,7 +230,6 @@ function install_apps_selected {
             fi
         fi
         app_index=$((app_index+1))
-
     done
 
     # if no apps to be installed then don't do anything
@@ -299,6 +298,9 @@ args="$1"
 
 if [ "$2" ]; then
     if [[ "$args" == "add" || "$args" == "remove" ]]; then
+        app_name_upper=$(echo "$2" | awk '{print toupper($0)}')
+        read_config_param "${app_name_upper}_DOMAIN_NAME"
+        read_config_param "${app_name_upper}_CODE"
         if [[ "$args" == "add" ]]; then
             select_specific_app "$2" "1"
         else
diff --git a/src/freedombone-installer b/src/freedombone-installer
index ecf0eb4e1..1112b48cb 100755
--- a/src/freedombone-installer
+++ b/src/freedombone-installer
@@ -840,11 +840,11 @@ function install_apps_from_webadmin {
                     fi
                 fi
 
-                if ! /usr/local/bin/${PROJECT_NAME}-addremove add "${app_name}" > "$webadmin_install_dir/log.txt"; then
+                if ! /usr/local/bin/${PROJECT_NAME}-addremove add "${app_name}" > "$webadmin_install_dir/applog.txt"; then
                     sed -i "/$linestr/d" "$pending_installs"
                     web_admin_create_add_apps
                 fi
-                chown www-data:www-data "$webadmin_install_dir/log.txt"
+                chown www-data:www-data "$webadmin_install_dir/applog.txt"
             fi
             # remove the line
             sed -i "/$linestr/d" "$pending_installs"
-- 
GitLab