0
I am currently using the command: curl icanhazip.com
and the option set -g status-left ...
in my tmux.conf to retrieve and display my public IP in status bar.
This works great, although I am really bothered by the number of requests that are being made to retrieve the same IP over and over again.
Question:
How can I acheive this (retrieve/display public IP in tmux status–bar) with only one communication stream per session (or something less redundant) using the tmux configuration?
I have looked through curl's man page and tried various rate limiting args in the command [to no avail], though I think this is something specific to tmux.
I could use an external script or function of some kind to accomplish this although i'd like to keep this simple.
Any suggestions to solve this or alternate methods entirely would be great!
edit: formatting
Is there a problem with using
ifconfig
to get the IP addr of your interface? – JezC – 2014-08-15T14:10:32.840In most cases
ifconfig
orip addr
will only display my local/NAT IP. That is sufficient for most of my VPS' which are not abstracted by NAT. – jredd – 2014-08-15T14:18:02.663What triggers a change in the NAT-ed IP address? Powercycle? Out of your control? Timer? Non-use for a while? Something else? – JezC – 2014-08-15T14:53:15.850
In my tmux.conf I have a line in there for my local IP using
ipconfig
in addition to a line that gets my public facing WAN IP. On my VPS these two are the same. But on my local machines and servers they will not be the same. – jredd – 2014-08-15T15:03:43.810