From f512f79fcc998a6553da9432433f54c4094483a5 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Tue, 31 Jul 2018 20:23:44 +0100
Subject: [PATCH] Check that password exists

---
 src/freedombone-utils-webadmin | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/freedombone-utils-webadmin b/src/freedombone-utils-webadmin
index 87f0c9300..53d050289 100755
--- a/src/freedombone-utils-webadmin
+++ b/src/freedombone-utils-webadmin
@@ -525,8 +525,8 @@ function web_admin_setup_login {
 
         # create a password file used by nginx
         echo -n "$webadmin_password" | htpasswd -i -s -c /etc/nginx/.webadminpasswd "admin"
-        if [ ! -f /etc/nginx/.webadminpasswd ]; then
-            echo $'/etc/nginx/.webadminpasswd not found'
+        if ! grep -q 'admin:' /etc/nginx/.webadminpasswd; then
+            echo $'/etc/nginx/.webadminpasswd password not created for admin'
             exit 2428956
         fi
 
-- 
GitLab