Hello! I use an RMM platform to monitor VMs hosted in the cloud that run FreePBX 16. This RMM platform allows me to run bash scripts in mass, at certain times, collect results and use them as conditions for monitoring and alerting, some pretty cool stuff. We use it a lot for automating things including fixes and ensuring proper config of our FreePBX servers.
Something that came up recently was an issue with LetsEncrypt not being able to generate/regenerate an SSL cert and generating a port 80 error. Turns out this was occurring because under System Admin > Port Management (see uploaded screencap), the insecure port for Admin was set to 80 and LetsEncrypt was disabled. Changing admin to port 8080 and LetsEncrypt to 80 fixes the error and allows the cert to generate/regenerate properly. And also ensuring that the HTTPS Address dropdown is selected on the FQDN of the server accordingly.
What I’d like to do is figure out a way to automate checking and fixing those dropdown settings via CLI. I’ve done some research and fwconsole sa ports will give me a readout of the ports, but I am not sure how to set them. I tried fwconsole sa ports --set=leport:80 and the command executes but it never actually updates the port when I check fwconsole sa ports. I also tried updating the database directly via mysql -D asterisk -e “UPDATE sysadmin_options SET value=‘80’ WHERE `key`=‘leport’;” and fwconsole reload, but when I do fwconsole sa ports it still isn’t showing leport as 80 and the GUI never updates either.
Am I missing something obvious? Can someone point me in the right direction for how to accomplish what I am looking to do?