fix networking

This commit is contained in:
David Young
2026-04-27 16:03:53 -06:00
parent a3a9c5215d
commit 90731bb811
2 changed files with 36 additions and 0 deletions

27
fix-networking.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
#
# Purpose : Configure Avahi mDNS and disable systemd-resolved
set -e
echo "Installing Avahi and nss-mdns..."
sudo pacman -S --noconfirm avahi nss-mdns
echo "Enabling Avahi daemon..."
sudo systemctl enable avahi-daemon.service
echo "Updating /etc/nsswitch.conf..."
sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf
# Verify the change was made
if grep -q "mdns_minimal" /etc/nsswitch.conf; then
echo "nsswitch.conf updated successfully."
else
echo "Error: nsswitch.conf was not updated. Please check the file manually."
exit 1
fi
echo "Copying Avahi SSH service file..."
sudo cp /usr/share/doc/avahi/ssh.service /etc/avahi/services/
echo "Avahi mDNS configuration complete."

View File

@@ -180,6 +180,15 @@ if ! bash install-openhamclock.sh; then
INSTALL_SUCCESS=false INSTALL_SUCCESS=false
fi fi
# Fix networking (Avahi mDNS)
echo "Configuring networking..."
if ! bash fix-networking.sh; then
echo "Warning: fix-networking.sh encountered errors. mDNS may not be configured correctly."
INSTALL_SUCCESS=false
fi
# Install Compiled Servers # Install Compiled Servers
echo "Installing compiled servers..." echo "Installing compiled servers..."