this post was submitted on 30 Apr 2025
3 points (80.0% liked)

Bash

892 readers
1 users here now

Talk about the Bash Shell and Bash scripting

founded 5 years ago
MODERATORS
 

I wrote pmtud.sh this weekend to get the MTU of a link (or tunnel) quickly, reliably, and without sending a ton of pings. It can do so in about 11 pings per target.

I had fun writing the entire thing in sh, tried making it "POSIX-compliant," but probably failed somewhere since POSIX isn't worded well. The script only needs dig and ping and uses shell built-ins for everything else. It performs a recursive binary search on the MTU search domain and asynchronously queues pings for later.

you are viewing a single comment's thread
view the rest of the comments
[–] mastertraitor@programming.dev 1 points 1 week ago

Saved my bacon with this comment. Fixed a ton of (seemingly) innocuous errors.