From 50363c6c6a2d6974ed4da02ea49d7712cd1ca401 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Sat, 26 May 2018 15:33:38 +0100
Subject: [PATCH] Get the local hostname first

---
 src/freedombone-utils-android | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/freedombone-utils-android b/src/freedombone-utils-android
index 829584fe9..885a78dea 100755
--- a/src/freedombone-utils-android
+++ b/src/freedombone-utils-android
@@ -31,15 +31,15 @@ function android_update_apps {
         detect_installable_apps
     fi
 
+    local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
+    plinth_api="/var/www/${local_hostname}/htdocs/plinth/api/1"
+
     # Create a self-signed cert if needed
     # The FreedomBox app assumes a self-signed cert
     if [ ! -f "/etc/ssl/certs/${local_hostname}.crt" ]; then
         install_web_local_user_interface
     fi
 
-    local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
-    plinth_api="/var/www/${local_hostname}/htdocs/plinth/api/1"
-
     if [ ! -d "/var/www/${local_hostname}/htdocs/plinth/api" ]; then
         mkdir -p "/var/www/${local_hostname}/htdocs/plinth/api"
     fi
-- 
GitLab