Get the local hostname first

This commit is contained in:
Bob Mottram 2018-05-26 15:33:38 +01:00
parent 5f2aa9e5e9
commit 50363c6c6a
1 changed files with 3 additions and 3 deletions

View File

@ -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