pkgs/openwrt/uci-config: add mtu hotfix

This commit is contained in:
Astro 2022-09-15 19:19:54 +02:00
parent fca953a92f
commit 3876228a38
1 changed files with 14 additions and 0 deletions

View File

@ -294,6 +294,20 @@ in
uci commit
# Add hotfixes for MTU settings
cat >/etc/hotplug.d/iface/99-mtu <<__MTU__
#!/bin/sh
${concatMapStrings (net:
optionalString (config.site.net ? ${net} &&
config.site.net.${net}.mtu != null) ''
if [ "\\\$ACTION" = ifup -a "\\\$INTERFACE" = ${net} ]; then
ip link set ${net} mtu ${toString config.site.net.${net}.mtu}
fi
'') (builtins.attrNames hostConfig.interfaces)
}
__MTU__
${optionalString hostConfig.wifiOnLink.enable ''
# Cronjob that makes sure WiFi is only visible when server with all
# the gateways is reachable