output="$(ip route get "${BASH_REMATCH[1]}"||true)"
[[($output=~ mtu\ ([0-9]+)||($output=~ dev\ ([^ ]+)&&$(ip link show dev "${BASH_REMATCH[1]}")=~ mtu\ ([0-9]+)))&&${BASH_REMATCH[1]} -gt $mtu]]&&mtu="${BASH_REMATCH[1]}"
done < <(wg show "$1" endpoints)
if[[$mtu -eq 0]];then
read -r output < <(ip route show default ||true)||true
[[($output=~ mtu\ ([0-9]+)||($output=~ dev\ ([^ ]+)&&$(ip link show dev "${BASH_REMATCH[1]}")=~ mtu\ ([0-9]+)))&&${BASH_REMATCH[1]} -gt $mtu]]&&mtu="${BASH_REMATCH[1]}"