Refactor sysinfo
Sorry, but could you rebase your modifications on the main branch?
Here we go :)
original message:
I am not sure all will interest you but I have passed a few hours to refactor the sysinfo python script for my own usage :
- use python3
- dropped utmp for a more trivial output with the command "who"
- use the findmnt command to filter the mounts and produce a more compact output
- added error handling on theses statfs calls
- restored the ip of the main interface
- use a main function
To be honest, I don’t like displaying the IP address in the banner. You choose to display only one IP address into the many possibles (it may not suite all users) and ip route list dev won’t work on IPv6-only machines.
And I prefer having multiple login showing, with their IP address and time, as:
- it allows me to know if I’m already logged
- it allows me to see all the IP addresses of those connections (better for security)
- if a co-worker has an old session on the server, I can ask them if it’s on purpose or if they can logout, allowing me, for ex., to reboot the server
We may have a config file to change the behavior of the script, like the hushlogin file.
Luc Didry @.***> writes:
To be honest, I don’t like displaying the IP address in the banner. You choose to display only one IP address into the many possibles (it may not suite all users) and ip route list dev won’t work on IPv6-only machines.
And I prefer having multiple login showing, with their IP address and time, as:
• it allows me to know if I’m already logged • it allows me to see all the IP addresses of those connections (better for security) • if a co-worker has an old session on the server, I can ask them if it’s on purpose or if they can logout, allowing me, for ex., to reboot the server
We may have a config file to change the behavior of the script, like the hushlogin file.
That is fair, give me some time to address it.
Concerning the findmnt command, I choose the '--fstab' flag because I want to keep the output terse by eg, not displaying all bind mount that can be generated by docker or other software.
I can also revise that and/or address it via configurations options.
Hello @ldidry,
Finally after following your indication, this pull request become mainly
about using findmnt to construct a more compact view of the filesystems.
What do you think ?