OutsideIT / FireMotD

:fire: Fire Framework Linux MoTD Generator :fire:
https://outsideit.net/firemotd
GNU General Public License v3.0
174 stars 45 forks source link

Ip address not shown #21

Closed dimon222 closed 7 years ago

dimon222 commented 7 years ago

I'm user of VPS under OpenVZ. Not sure if its related to specific virtualization options, but the route is not returning "via" part. Basically it causes offset for awk arguments, so the f8 is empty string.

What it usually returns (excluding cache part): 192.168.0.1 via x.x.x.x dev interface0 src y.y.y.y

What it returns for my OpenVZ container: 192.168.0.1 dev interface0 src y.y.y.y

So the result is f6 instead of f8.

willemdh commented 7 years ago

@dimon222 I tried many ways to find the ip addresses and route was the most correct. You could check with a regex or so if the output of f8 is an ip and if not retry with f6?

mjohansona2 commented 7 years ago

f6 does indeed pop the IP Address on OpenVZ.

willemdh commented 7 years ago

@dimon222 @a2mj Feel free to make a PR to detect and fix this.

ThomDietrich commented 7 years ago

f6 didn't work for me...