Commit Graph

4 Commits

Author SHA1 Message Date
467b967ced tmux-ip: portable local-IP fallback for macOS
`hostname -I` is GNU-only and errors on BSD/macOS, so when the public-IP
curl couldn't reach api.ipify.org the script printed nothing and the
tmux status bar showed an empty IP. Try `ipconfig getifaddr` for common
interfaces first, fall back to `hostname -I` on Linux, then `ifconfig`
as a last resort. Also guard against empty-but-zero-exit curl output.
2026-05-17 03:12:11 -07:00
18ddfc9ad6 tmux-ip: fix DO metadata path (address -> ip_address)
The DigitalOcean metadata endpoint for reserved/floating IPv4 is
/metadata/v1/{reserved,floating}_ip/ipv4/ip_address, not .../address.
The .../active check works but the wrong IP path returned an empty
body, causing the script to silently fall through to ipify on every
droplet with a reserved/floating IP attached.

Verified on a droplet:
  curl .../reserved_ip/ipv4/ip_address -> 45.55.111.240
  curl .../reserved_ip/ipv4/address    -> (empty)
2026-04-21 07:20:51 -07:00
129d77471b tmux-ip: prefer DigitalOcean reserved/floating IP when on a droplet
If /sys/class/dmi/id/sys_vendor says DigitalOcean and the droplet has
a reserved_ip or floating_ip assigned, use that over the ipify-based
egress IP. Keeps the ipify/hostname -I fallback intact for other hosts.

Gated on the DMI check so non-DO hosts skip the metadata probe entirely
and the tmux status bar refresh stays fast.
2026-04-21 07:10:13 -07:00
0affdd1fb7 Add tmux-ip helper script with public/internal IP fallback 2026-04-21 06:16:16 -07:00