From b049d8baed9fe81877bfa0a2c890d4c6cafae63d Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Wed, 1 Aug 2018 18:40:17 +0100
Subject: [PATCH] Tidying

---
 src/freedombone-installer | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/freedombone-installer b/src/freedombone-installer
index cbdd3c799..2f7c54431 100755
--- a/src/freedombone-installer
+++ b/src/freedombone-installer
@@ -101,9 +101,26 @@ do
                 # switch on nginx authentication for freedombone.local
                 sed -i 's|#auth_basic|auth_basic|g' "/etc/nginx/sites-available/${local_hostname}"
 
-                # Show the web admin index page (not the initial setup page)
                 if [ -f "$webadmin_install_dir/index.prev" ]; then
+                    # Replace the installing screen with the main index page when done
+                    # It should reload by itself
+                    if [ -f "$webadmin_install_dir/setup_installing.prev" ]; then
+                        cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/setup_installing.html"
+                    fi
+
+                    # Replace the setup confirm screen with the main index
+                    if [ -f "$webadmin_install_dir/setup_confirm.html" ]; then
+                        cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/setup_confirm.html"
+                    fi
+
+                    # Replace the setup domain screen with the main index
+                    if [ -f "$webadmin_install_dir/setup_domain.html" ]; then
+                        cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/setup_domain.html"
+                    fi
+
+                    # Show the web admin index page (not the initial setup page)
                     cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/index.html"
+                    rm "$webadmin_install_dir/index.prev"
                 fi
 
                 # Remove the initial setup page
@@ -111,21 +128,6 @@ do
                     rm "$webadmin_install_dir/setup.prev"
                 fi
 
-                # Replace the installing screen with the main index page when done
-                # It should reload by itself
-                if [ -f "$webadmin_install_dir/setup_installing.prev" ]; then
-                    cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/setup_installing.html"
-                fi
-
-                # Replace the setup confirm screen with the main index
-                if [ -f "$webadmin_install_dir/setup_confirm.html" ]; then
-                    cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/setup_confirm.html"
-                fi
-
-                # Replace the setup domain screen with the main index
-                if [ -f "$webadmin_install_dir/setup_domain.html" ]; then
-                    cp "$webadmin_install_dir/index.prev" "$webadmin_install_dir/setup_domain.html"
-                fi
 
                 # set permissions for web admin site at freedombone.local
                 chown www-data:www-data "$webadmin_install_dir/*.html"
-- 
GitLab