From 864a2af45e75be12db8f94687f8754f148121f1c Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Wed, 4 Sep 2024 04:47:43 +0300 Subject: [PATCH] kvmd-bootconfig: ensure avahi service on ENABLE_AVAHI --- scripts/kvmd-bootconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/kvmd-bootconfig b/scripts/kvmd-bootconfig index d97f10fa..06f41dbb 100755 --- a/scripts/kvmd-bootconfig +++ b/scripts/kvmd-bootconfig @@ -53,7 +53,7 @@ source <(dos2unix < /boot/pikvm.txt) rw -# ========== First boot configuration ========== +# ========== First boot and/or Avahi configuration ========== make_avahi_service() { local _serial @@ -130,10 +130,10 @@ if [ -n "$FIRSTBOOT$FIRST_BOOT" ]; then which fc-cache && fc-cache || true fi - -# ========== Avahi ========== - if [ -n "$ENABLE_AVAHI" ]; then + if [ ! -f /etc/avahi/services/pikvm.service ]; then + make_avahi_service + fi systemctl enable avahi-daemon || true touch /boot/pikvm-reboot.txt fi