From 0c17a4ab5d923a3e6c03bdc6c9b412aefbaf8316 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Sun, 19 May 2024 19:44:50 +0200 Subject: [PATCH] Fix Linux optimizations --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run index ca9564b1..d3666a67 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run @@ -4,6 +4,7 @@ # Home Assistant Community Add-on: Tailscale # Runs after the machine has been logged in into the Tailscale network # ============================================================================== +declare default_route_device declare -a options declare -a routes=() declare route @@ -16,7 +17,10 @@ declare keyexpiry # Based on: https://tailscale.com/kb/1320/performance-best-practices#linux-optimizations-for-subnet-routers-and-exit-nodes # Note: Changes made via ethtool are not persistent and will be lost after the machine shuts down. # Note: Executing it before "tailscale up" to avoid warning messages -ethtool -K $(ip route show 0/0 | cut -f5 -d' ') rx-udp-gro-forwarding on rx-gro-list off +default_route_device=$(ip -4 route show 0/0 | cut -f5 -d' ') +if bashio::var.has_value "${default_route_device}"; then + ethtool -K "${default_route_device}" rx-udp-gro-forwarding on rx-gro-list off +fi # Default options options+=(--hostname "$(bashio::info.hostname)")