From 9ea03e18c9a9a28ce8e3c4421625c337e2f8217d Mon Sep 17 00:00:00 2001 From: downtownallday Date: Tue, 14 Sep 2021 09:56:19 -0400 Subject: [PATCH] automatically install avahi for systems with a .local tld --- tests/system-setup/setup-funcs.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/system-setup/setup-funcs.sh b/tests/system-setup/setup-funcs.sh index 28d35c90..94a07cbc 100755 --- a/tests/system-setup/setup-funcs.sh +++ b/tests/system-setup/setup-funcs.sh @@ -92,6 +92,15 @@ init_test_system() { wait_for_apt apt-get upgrade -qq || die "apt-get upgrade failed!" fi + + # install avahi if the system dns domain is .local - note that + # /bin/dnsdomainname returns empty string at this point + case "$PRIMARY_HOSTNAME" in + *.local ) + wait_for_apt + apt-get install -y -qq avahi-daemon || die "could not install avahi" + ;; + esac } @@ -234,6 +243,11 @@ miab_ldap_install() { # set actual STORAGE_ROOT, STORAGE_USER, PRIVATE_IP, etc . /etc/mailinabox.conf || die "Could not source /etc/mailinabox.conf" + + # setup changes the hostname so avahi must be restarted + if systemctl is-active --quiet avahi-daemon; then + systemctl restart avahi-daemon + fi }