From eee70dbe696df960171aa4a3feb8d8384a08d8eb Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Fri, 17 Aug 2018 11:02:43 +0100
Subject: [PATCH] Include onion only status in config file

---
 src/freedombone-utils-webadmin | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/freedombone-utils-webadmin b/src/freedombone-utils-webadmin
index bb1a1c35d..662e23650 100755
--- a/src/freedombone-utils-webadmin
+++ b/src/freedombone-utils-webadmin
@@ -626,7 +626,15 @@ function image_install_web_admin {
     cp -r "$rootdir/usr/share/${PROJECT_NAME}/webadmin"/* "$rootdir$webadmin_install_dir"
     cp "$rootdir/usr/share/${PROJECT_NAME}/webadmin/${language_subdir}"/*.html "$rootdir$webadmin_install_dir"
     cp "$rootdir$webadmin_install_dir/${language_subdir}"/index.html "$rootdir$webadmin_install_dir"/index.prev
-    read_config_param ONION_ONLY
+
+    # include onion only status in the config file
+    # because add/remove app screens alter depending upon this
+    if ! grep -q 'ONION_ONLY=' "$rootdir$CONFIGURATION_FILE"; then
+        echo "ONION_ONLY=$ONION_ONLY" >> "$rootdir$CONFIGURATION_FILE"
+    else
+        sed -i "s|ONION_ONLY=.*|ONION_ONLY=$ONION_ONLY|g" "$rootdir$CONFIGURATION_FILE"
+    fi
+
     if [[ "$ONION_ONLY" != 'no' ]]; then
         web_admin_onion_only
     fi
-- 
GitLab