Show CLI command equivalent of every GUI change one makes in real time.
-
Hello Developers,
I've been a pfSense fan since the beginning. I have to say, "GREAT JOB!". My problem is is that I've always been a GUI tech. I've been trying very hard to get into CLI. Some progress but not as thorough as I would like to be. I ran into this article http://www.networkcomputing.com/networking/gui-vs-cli-networking/2083404544. The second to last paragraph sums it up. How hard would it be to implement this into the already great, pfSense. I think it would be a great addition to the project
-
Nearly impossible. Not everything has a CLI equivalent, some things are done through helper functions that use APIs and other interfaces to lower-level functions so it's not always a GUI wrapper around shell commands.
In places where commands are executed, you could probably patch the mwexec and mwexec_bg functions to log what they're running somewhere, but because things are formed programmatically, the odds of them being very useful for human readers would be low in many cases.
It might be interesting for a very small number of people, but not enough I would see it making its way in as a feature.
-
And a lot of settings end up being written to a conf file somewhere and then the appropriate service is restarted, which just reads the conf file. So such a thing would need to show the diff of the conf file before/after so you can see what happens in the back-end as the front-end changes.
-
…So such a thing would need to show the diff of the conf file before/after so you can see what happens in the back-end as the front-end changes.
Luckily, we have that already!
At Diagnostics / Backup & Restore / Config History you can diff between selected config files. That's great (and I only found it by accident. But I love it.) -
…So such a thing would need to show the diff of the conf file before/after so you can see what happens in the back-end as the front-end changes.
Luckily, we have that already!
At Diagnostics / Backup & Restore / Config History you can diff between selected config files. That's great (and I only found it by accident. But I love it.)I meant that there could (also) be a diff available of the end-result conf file from the change (e.g. dhcp.conf unbound.conf etc files) - that would show people what it is that they would have to have done/edited on a "raw" FreeBSD system in order to make the equivalent change.
That would be some effort to implement. -
…in the end we are all aware that it's not too brilliant an idea to change config/ini files in pfSense except for config.xml
At least if you want it to work after updates/upgrades as well.
This single config file is one of pfSense's beauties, isn't it? -
Had it been possible, although I still think it is, apart from it being a great learning tool for those that don't know CLI, wouldn't it be a great GUI troubleshooting tool? For example, if one changes something in the GUI and the show-command-line shows something, for those that know CLI will be able to see if the GUI did the commands correct or incorrect.
-
As a diagnostic learning tool, take a look at the comprehensive output of status.php. (I don't think it's a gui menu choice, just go to https://192.168.1.1/status.php, for example).
Find an area you want to learn about, then read through /usr/local/www/status.php and see how that output was generated. A far cry from what you are asking for, but still a good place to learn