fix networking
This commit is contained in:
27
fix-networking.sh
Normal file
27
fix-networking.sh
Normal 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."
|
||||||
@@ -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..."
|
||||||
|
|||||||
Reference in New Issue
Block a user