From 1ec4b47da65299bb3a837102657149b3d6d1d3b1 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 12 Dec 2024 17:54:27 -0400 Subject: [PATCH] udev --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 622dc50..13a6e81 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ spirilink-driver: .PHONY: configure-spirilink configure-spirilink: @echo "Configuring SpiriLink interface as spir0..." - spirilink_iface=$$(iw dev | awk '$$1=="Interface"{print $$2}' | head -n 1); \ + @spirilink_iface=$$(iw dev | awk '$$1=="Interface"{print $$2}' | head -n 1); \ if [ -z "$$spirilink_iface" ]; then \ echo "Error: SpiriLink interface not detected."; \ exit 1; \ @@ -114,23 +114,24 @@ configure-spirilink: echo "Detected SpiriLink interface: $$spirilink_iface"; \ mac_address=$$(cat /sys/class/net/$$spirilink_iface/address); \ echo "Detected MAC address: $$mac_address"; \ - echo 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="'$$mac_address'", NAME="spir0"' | $(SUDO) tee /etc/udev/rules.d/99-spirilink.rules; \ + echo 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="'$$mac_address'", NAME="spir0"' | $(SUDO) tee /etc/udev/rules.d/99-spirilink.rules > /dev/null; \ $(SUDO) udevadm control --reload-rules; \ $(SUDO) udevadm trigger; @echo "Adding spir0 to unmanaged devices in NetworkManager..." - $(SUDO) mkdir -p /etc/NetworkManager - $(SUDO) touch /etc/NetworkManager/NetworkManager.conf + @$(SUDO) mkdir -p /etc/NetworkManager + @$(SUDO) touch /etc/NetworkManager/NetworkManager.conf @if ! grep -q "\[keyfile\]" /etc/NetworkManager/NetworkManager.conf; then \ echo "[keyfile]" | $(SUDO) tee -a /etc/NetworkManager/NetworkManager.conf > /dev/null; \ fi @if ! grep -q "unmanaged-devices=interface-name:spir0" /etc/NetworkManager/NetworkManager.conf; then \ echo "unmanaged-devices=interface-name:spir0" | $(SUDO) tee -a /etc/NetworkManager/NetworkManager.conf > /dev/null; \ fi - $(SUDO) systemctl restart NetworkManager + @$(SUDO) systemctl restart NetworkManager @echo "Configuring wifibroadcast default interface..." - $(SUDO) bash -c 'echo "WFB_NICS=\"spir0\"" > /etc/default/wifibroadcast' + @$(SUDO) bash -c 'echo "WFB_NICS=\"spir0\"" > /etc/default/wifibroadcast' @echo "SpiriLink configuration complete." + # Install SpiriLink software .PHONY: spirilink-software spirilink-software: