From 1459a0462599839a3f4a0e4b36065dc196a2422e Mon Sep 17 00:00:00 2001
From: Timothee 'TTimo' Besset <ttimo@valvesoftware.com>
Date: Tue, 15 Nov 2022 14:39:30 -0600
Subject: [PATCH] make sure avahi-daemon is enabled

---
 hackendeck/configure-hackendeck.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hackendeck/configure-hackendeck.py b/hackendeck/configure-hackendeck.py
index 826eee9..1da64e8 100755
--- a/hackendeck/configure-hackendeck.py
+++ b/hackendeck/configure-hackendeck.py
@@ -39,4 +39,10 @@ if __name__ == '__main__':
         logger.info('installing packages for the service')
         subprocess.check_call('sudo -A pacman -S avahi dbus-python zenity', shell=True)
 
+    enable_avahi = ( subprocess.run('systemctl status avahi-daemon 2>&1 >/dev/null', shell=True).returncode != 0 )
+    if enable_avahi:
+        logger.info('avahi-daemon needs to be enabled')
+        subprocess.check_call('sudo -A systemctl enable --now avahi-daemon', shell=True)
+    logger.info('avahi-daemon is enabled')
+
     logger.info('======== hackendeck configuration complete ==========')
-- 
GitLab